Skip to main content
All docs
V24.1

Localize Blazor Reporting Components

  • 3 minutes to read

Report Viewer (Native)

To localize the Native Report Viewer component, follow the guidelines in the following help topic: DevExpress Blazor Components- Localization. This solution will work because the user interface of the Native Report Viewer component is based on DevExpress Blazor Components.

Document Viewer and Report Designer (JS-Based)

To localize the JavaScript-Based Document Viewer component, use the guidelines described in the following help topic: DevExtreme Localization. This method applies to Devexpress JS-based Reporting components because the user interface of these components is built with DevExtreme widgets.

The following code snippet forces UI widgets to use the German locale in a Blazor application:

function OnCustomizeLocalization(s, e) {
    s.dx.localization.locale('de');
}

To use the de locale, you should register the de.js file on the web page as described in the following help topic: DevExtreme Localization - Using Globalize.

Note that the JavaScript-based Blazor Reporting components use the ASP.NET Core backend. You can find additional information on localization in the following help topic: Localize ASP.NET Core Reporting Components.

UI Localization Client

The UI Localization Client is a cross-platform utility that allows you to quickly identify non-translated strings of DevExpress UI controls and translate them during a debug session. The utility automatically generates a RESX file(s) with translated resources and adds it to the project. Note that the UI Localization Client loads all Web Reporting resource strings once the controls are rendered, without reflecting your interaction with the UI.

The UI Localization Client can be used with the following Reporting Components in a Blazor application:

  • JavaScript-Based Reporting Controls for Blazor Server
  • JavaScript-Based Reporting Controls for Blazor WebAssembly Hosted
  • Native Report Viewer for Blazor Server

To use the UI Localization Client in a Blazor WebAssembly application, make sure that the application gets the localization from the server. You can use the GetLocalizationAction property.

For more information refer to the following topic: UI Localization Client.

The resource strings for the Web Reporting Controls (Web Document Viewer and Web Report Designer) are located in the following localization containers in the UI Localization Client window:

DevExpress.XtraReports.Web.Localization.LocalizationContainer
Contains localization strings specific only to the Web Reporting Controls.
DevExpress.Utils.Localization.CoreLibraryResources
Contains cross-platform localization strings used in the Web Reporting Controls.
DevExpress.Web.Resources.Localization.LocalizationContainer
Contains localization strings common to DevExpress Web Components used in the Web Reporting Controls.

Troubleshooting

  • If you followed the instructions in the UI Localization Client topic and the translated resources do not appear on your web page, try clearing browser cache.
  • If you followed the instructions in the UI Localization Client topic and the resource strings do not appear in the UI Localization Client window, call the HandleRequestsFromAllThreads() method at application startup to use localizer objects across all application threads.

Identify Non-Translated Strings

  • Use our UI Localization Client tool shipped as part of your DevExpress subscription. This tool streamlines the entire localization process. You can quickly find non-translated strings and translate them during a debug session.
  • Handle the XtraLocalizer.QueryLocalizedStringNonTranslated event to collect non-localized resource strings for further translation. The event allows you to focus on strings that require translation in your application.