Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

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.

src/main.ts (import locale)
      
      import '@angular/common/locales/global/fr';
    

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

Last reviewed on Wed Aug 30 2023