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

TRANSLATIONS

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

Description

Use this token at bootstrap to provide the content of your translation file (xtb, xlf or xlf2) when you want to translate your application in another language.

See the i18n guide for more information.

Example

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

// content of your translation file
const translations = '....';

platformBrowserDynamic().bootstrapModule(AppModule, {
  providers: [{provide: TRANSLATIONS, useValue: translations }]
});