Skip to main content

DxDocumentViewerCallbacks.CustomizeLocalization Property

Specifies the handler for the CustomizeLocalization client-side event that allows you localize the Web Document Viewer.

Namespace: DevExpress.Blazor.Reporting

Assembly: DevExpress.Blazor.Reporting.v22.1.JSBasedControls.dll

NuGet Package: DevExpress.Blazor.Reporting.JSBasedControls

Declaration

[Parameter]
public string CustomizeLocalization { get; set; }

Property Value

Type Description
String

The name of a JavaScript function used to handle the CustomizeLocalization event.

Remarks

The CustomizeLocalization event enables you to localize the Web Document Viewer. Use the event argument’s LoadMessages method to load JSON files obtained from the DevExpress Localization Service.

The code below applies the German localized resources from JSON files. Localization files are in the wwwroot/js/localization folder.

For information on how to obtain the JSON localization files, refer to the following help topic: Localize Your ASP.NET Core Reporting Application.

window.ReportingViewerCustomization = {
    //Apply German localization.
    onCustomizeLocalization: function(s, e) {
        $.get("/js/localization/de.json").done(result => {
            e.WidgetLocalization.loadMessages(result);
        }).always(() => {
            e.WidgetLocalization.locale("de");
        })

        e.LoadMessages($.get("/js/localization/dx-analytics-core.de.json"));
        e.LoadMessages($.get("/js/localization/dx-reporting.de.json"));
    }
}
See Also