TRANSLATIONS
상수
안정화
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.
설명
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
In standalone apps:
import { LOCALE_ID, ApplicationConfig } from '@angular/core';
const appConfig: ApplicationConfig = {
providers: [{provide: TRANSLATIONS, useValue: translations }]
};
In module based apps:
import { TRANSLATIONS } from '@angular/core';
import { platformBrowser } from '@angular/platform-browser';
import { AppModule } from './app/app.module';
// content of your translation file
const translations = '....';
platformBrowser().bootstrapModule(AppModule, {
providers: [{provide: TRANSLATIONS, useValue: translations }]
});
상세 내용으로 이동