This is the archived documentation for Angular v5. Please visit angular.io to see documentation for the current version of Angular.

LOCALE_ID

npm Package @angular/core
Module import { LOCALE_ID } from '@angular/core';
Source core/src/i18n/tokens.ts
      
      const LOCALE_ID: any;
    

Description

Provide this token to set the locale of your application. It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe, DecimalPipe and PercentPipe) and by ICU expressions.

See the i18n guide for more information.

Example

      
      import { LOCALE_ID } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule, {
  providers: [{provide: LOCALE_ID, useValue: 'en-US' }]
});