xtrareports-402592-web-reporting-common-features-localization-localization-in-an-angular-application.md
This topic describes how to localize the Document Viewer and End-User Report Designer UI in an Angular application.
In the Angular application you can import the localized JSON resources and use the CustomizeLocalization callback to call the LoadMessages method that loads localized strings.
Log into the DevExpress website.
Open the DevExpress Localization Service.
Select your target language, modify translations, and click the Download button. Refer to the following help topic for detailed information: Localization Service.
Unpack the downloaded executable file to get the satellite assemblies and json resources directory. This directory contains the following JSON files required to localize the reporting controls (where xx is a culture name):
Tip
The component’s UI is built on DevExtreme widgets, so to localize the editors you should also use one of the approaches described in the following topic: DevExtreme - Localization. Specify web server’s thread culture to apply culture-specific formats to numbers and dates.
View Example: How to Localize the Reporting Controls in an Angular JavaScript Application
The steps below are based on an Angular Reporting application created from DevExpress template as described in the following help topics:
Copy the dx-analytics-core.xx.json, dx-reporting.xx.json, and dx-rich.xx.json (optional) files (where xx is the culture ID) files obtained in the previous section to the application root folder (in this example, ClientApp/src).
Open a View file and insert the code that handles the CustomizeLocalization callback:
Add the Angular compiler options to import local JSON modules. Open the tsconfig.json file and set the resolveJsonModule and esModuleInterop options to true :
Open a View Model file and add the CustomizeLocalization event handler. Add import directives and use the LoadMessages method to load localized strings.
Recompile the project and open the application in the browser (default URL is http://localhost:4200/).
Note
The UI Localization Client requires localization recourses to be loaded from the server to work properly in an Angular application.
The UI Localization Client is a cross-platform utility that helps you identify non-translated strings in DevExpress UI controls and translate them during a debug session. The utility generates RESX files with translated resources and adds them to the project. The UI Localization Client loads all Web Reporting resource strings after the controls are rendered and does not reflect later UI interactions.
To use the UI Localization Client in you application:
CustomizeLocalization event to localize your application.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.LocalizationContainerContains localization strings specific only to the Web Reporting Controls.DevExpress.Utils.Localization.CoreLibraryResourcesContains cross-platform localization strings used in the Web Reporting Controls.DevExpress.Web.Resources.Localization.LocalizationContainerContains localization strings common to DevExpress Web Components used in the Web Reporting Controls.