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

Localization

  • 2 minutes to read

This document provides information on how to localize the Web Document Viewer using the built-in localization mechanisms and programmatically fine-tune the localization by substituting particular localization strings.

You can use one of the following approaches or both approaches simultaneously:

Use Satellite Resource Assemblies

You can localize the Web Document Viewer using Satellite Resource Assemblies (libraries that contain translated resources), which is a common approach to localizing .NET applications.

Refer to Localizing ASP.NET Controls via Satellite Resource Assemblies for more information.

Substitute Localization Strings

Call the ASPxClientWebDocumentViewer.UpdateLocalization method in the client-side ASPxClientWebDocumentViewer.CustomizeLocalization event to manually substitute a particular localization string with a custom one. This method receives an object containing key-value pairs that define localization for the specified strings.

Note that you can use this approach in conjunction with Satellite Resource Assemblies.

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

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

Important

Localization strings are case sensitive. A string is only translated if you specified it in the correct case.

On a web page, specific strings look different from their actual values. For instance, the ‘Search result’ string is actually displayed as ‘SEARCH RESULT’.

You can know the actual string value by finding the corresponding UI element in the page markup (for example, using your browser’s Developer Tools).

web-viewer-localization-browser-inspect