This project demonstrates how to use Globalize to localize DevExtreme widgets in an Angular application created via Angular CLI. In this project, we localize the DataGrid widget in the de locale.
DevExtreme Angular components were added to a project generated using Angular CLI (version 7.3.1). Then, the Globalize, CLDR, and JSZip (required for the DataGrid) packages were registered in the tsconfig.json file.
Note that starting from TypeScript 2.9, you don't need to provide ambient declarations for JSON files. Just enable the compilerOptions.resolveJsonModule and compilerOptions.esModuleInterop options in the tsconfig.json file.
To make it easier to load culture-dependent CLDR data, this example uses the devextreme-cldr-data package optimized for DevExtreme widgets.
For more information on localization in DevExtreme, refer to the Localization article.
-
Clone the repository
git clone https://github.com/devexpress/devextreme-examples.git -
Go to the project folder
cd devextreme-examples/angular-cli-globalize -
Install the required NPM packages.
npm installor
yarn install -
Run the example
npm run serveor
yarn run serve -
Open http://localhost:4200/ in the browser.