Localization

This document provides information on how to localize the Web Document Viewer and Report Designer 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 and Report Designer 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

You can manually substitute a particular localization string with a custom one in the following way:

These methods receive 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.

The code snippets below demonstrate how to fine-tune localization strings for the Document Viewer in ASP.NET WebForms and Report Designer in ASP.NET MVC:

  • ASP.NET WebForms

    <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>
    
  • ASP.NET MVC

    @Html.DevExpress().ReportDesigner(settings => {
        settings.Name = "ReportDesigner";
        settings.ClientSideEvents.CustomizeLocalization = "function(s) { " +
            "s.UpdateLocalization({"+
                "'Properties': 'Eigenschaften',"+
                "'Data Source': 'Datenquelle',"+
                "'Data Member': 'Datenelement'});}";
    }).Bind(new XtraReport()).GetHtml()
    
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