Skip to content

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.

shell
ng build --localize

HELPFUL

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.

ts
import '@angular/common/locales/global/fr';

HELPFUL

In an NgModules application, you would import it in your app.module.

Released under the MIT License.