Skip to main content
A newer version of this page is available. .

Localization - ASP.NET Web Forms Document Viewer

  • 2 minutes to read

To localize the Web Document Viewer, use the built-in localization mechanisms and substitute localization strings.

You can use any approach described below or both approaches simultaneously.

Use Satellite Resource Assemblies

You can localize the Web Document Viewer with the Satellite Resource Assemblies (libraries that contain translated resources).

For more information, review the following help topic: Localize ASP.NET Controls with Satellite Resource Assemblies.

Substitute Localization Strings

Use the LoadMessages method to load JSON files for ‘xx’ language, obtained from Localization Service:

<script type="text/javascript" id="script"> 
        function customizeLocalization(s, e) {
            e.LoadMessages($.get("/dx-analytics-core.de.json"));
            e.LoadMessages($.get("/dx-reporting.de.json"));
        }
</script> 

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server">
    <ClientSideEvents CustomizeLocalization="customizeLocalization"/>
</dx:ASPxWebDocumentViewer>

Use the UpdateLocalization method in the client-side ASPxClientWebDocumentViewer.CustomizeLocalization event handler to substitute a particular localization string with the specified text.

Tip

You can use the satellite resource assemblies to translate text strings and then adjust the translation by handling the CustomizeLocalization event.

<script type="text/javascript" id="script"> 
    function customizeLocalization(s) {
        s.UpdateLocalization({
            'Search': 'Suche',
            'Search result': 'Suchergebnisse',
            'Next Page' : 'Nächste Seite',
            'Export Options' : 'Exportoptionen'
        });
    }
</script> 

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server">
    <ClientSideEvents CustomizeLocalization="customizeLocalization"/>
</dx:ASPxWebDocumentViewer>

View Example: Reporting for Web Forms - Report Designer and Document Viewer Localization

Important

Localization strings are case sensitive. A string is translated if you use correct case to specify it.

On a web page localized string values may be capitalized in a different manner. E.g. the ‘Search result’ string is displayed as ‘SEARCH RESULT’.

To determine the localized string whose value you wish to change, look for the UI element with the browser’s Developer Tools, as illustrated in the following picture:

web-viewer-localization-browser-inspect