填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

LOCALE_ID

提供此令牌以设置应用程序的语言环境。它通过 i18n 管道(DatePipe、I18nPluralPipe、CurrencyPipe、DecimalPipe 和 PercentPipe)和 ICU 表达式用于 i18n 提取。

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.

查看"说明"...

      
      const LOCALE_ID: InjectionToken<string>;
    

说明

有关更多信息,请参见《 i18n 指南》。

See the i18n guide for more information.

Further information available in the Usage Notes...

使用说明

例子

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' }]
});