|
<< Click to Display Table of Contents >> Navigation: Gnostice Document Studio .NET > Going Deeper > Document Viewing > ASP.NET > Customizing the look and feel > Localizing the UI text |
The ASP.NET Document Viewer supports localization of the UI text using the jQuery.i18n module. Here are the steps to be followed to achieve this.
1.Download and add the "jquery.i18n.properties.min.js" file to your projects, and include it in the <head> section of the web page. You can download the JS file from link given below.
2.Make a copy of the Scripts/localization/Message.properties file and rename the file to match the desired language. For example "Message_fr.properties" for French.
3.Edit the renamed Message[_language].properties file to supply the strings for the given language. You can include as many of these Message[_language].properties files as needed.
4.Modify the document viewer preferences by providing the following settings. This is for setting the initial language when the document viewer loads.
// Specifies UI language selection settings.
preferences.localization.language = "fr";
preferences.localization.resourcePath = "Scripts/localization/";
5.You may need to allow downloading of the Message[_language].properties by providing a MIME type in the Web.config file or your webserver. The changes to be made to Web.config is given below.
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".properties" />
<mimeMap fileExtension=".properties" mimeType="text/plain" />
</staticContent>
</system.webServer>
</configuration>
6.Use the DocumentViewer.View.changeLanguage(language: string) API to switch the languages at runtime.