Skip to main content

Localizing the Query Builder

The Query Builder supports the built-in localization mechanisms and allows you to fine-tune the localization programmatically by substituting particular localization strings.

Use Satellite Resource Assemblies

You can localize the Query Builder like other .NET applications using Satellite Resource Assemblies (libraries that contain translated resources).

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 by calling the UpdateLocalization(localization) method in the client-side CustomizeLocalization event. This method receives an object containing key-value pairs that define the specified strings’ localization.

<dx:ASPxQueryBuilder ID="ASPxQueryBuilder1" runat="server" 
                     ClientInstanceName="clientQueryBuilder">
    <ClientSideEvents Init="function(s, e) {
        clientQueryBuilder.UpdateLocalization({
            'Save': 'Speichern',
            'Preview Results': 'Vorschau'
        });                
    }" />
</dx:ASPxQueryBuilder>

Note

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

You can use this approach in conjunction with Satellite Resource Assemblies.

Load JSON File with Localized Strings

To load the JSON file for localization, subscribe to the client-side CustomizeLocalization event as follows:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <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>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dx:ASPxQueryBuilder ID="ASPxQueryBuilder1" runat="server">
                <ClientSideEvents CustomizeLocalization="CustomizeLocalization" />
            </dx:ASPxQueryBuilder>
        </div>
    </form>
</body>
</html>