Localization in UWP PDF Viewer (SfPdfViewer)

4 Apr 20221 minute to read

Localization is the process of configuring the application to a specific language. SfPdfViewerControl provides support to localize the context menu. Localization can be done by adding resource file (Resw) and setting the specific culture in the application.

Setting language in the app manifest file

The following steps illustrates you how to configure the app package for localization using the manifest designer

  • In Solution Explorer, expand the project node of your UWP app.
  • Double-click the Package.appxmanifest file. If the manifest file is already open in the XML code view, Visual Studio prompts you to close the file.
  • Now specify the Default language on the Application tab as required to localize your app. Click on More information to know about the supported languages.

Package manifest

  • Save the app manifest file after setting the default language.

Adding Resource file

  • Create a folder with name ‘Resources’ in your application.
  • Create a folder with language (“en-US”, “fr-FR”, etc.) under ‘Resources’ to hold the resource file for the respective language.
  • Add default English (“en-US”) Resw(resource) file of SfPdfViewerControl in the ‘en-US’ folder, named as Syncfusion.SfPdfViewerControl.UWP.Resources.resw, Syncfusion.SfColorPickers.WinRT.Resources.resw and Localization.Resources. resw respectively. For your reference, French(“fr-FR”) Resw file.

Culture resources

  • Add the resource key such as name and its corresponding localized value in Resource Designer of Syncfusion.SfPdfViewerControl.UWP.Resources.resw, Syncfusion.SfColorPickers.WinRT.Resources.resw file.

Resource Dictionary

The following screenshot shows the localization of context menu in SfPdfViewerControl.