mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
f6ccb163aa
E2E tests passed locally **Added `readme.md` to the example code** This explains how to build and run the example for both English and French. **Archived `i18n-optional-manual-runtime-locale.md`** I was asked to cut out a substantial swath of this page by reviewer "zip-fa". All that remained was a brief paragraph. I removed the page from the navigation after copying the remaining text to `i18n-optional-import-global-variants.md`. The page is still reachable by 3rd party links. PR Close #51589
1.5 KiB
1.5 KiB
Import global variants of the locale data
The Angular CLI automatically includes locale data if you run the ng build command with the --localize option.
ng build --localize
The initial installation of Angular already contains locale data for English in the United States (en-US).
The Angular CLI automatically includes the locale data and sets the LOCALE_ID value when you use the --localize option with ng build command.
The @angular/common package on npm contains the locale data files.
Global variants of the locale data are available in @angular/common/locales/global.
import example for French
For example, you could import the global variants for French (fr) in main.ts where you bootstrap the application.
In an NgModules application, you would import it in your app.module.
@reviewed 2023-08-30