W3cubDocs

/Angular 12

TRANSLATIONS

const

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 more...

const TRANSLATIONS: InjectionToken<string>;

Description

See the i18n guide for more information.

Further information is available in the Usage Notes...

Usage notes

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

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/core/TRANSLATIONS