4

We're using Angular 5 with JIT and would like to replace the XLF content used for translations in the app, depending on a query string value. Not having a specific culture specified in the boot.browser.ts leads to all xlf files to be bundled into main-client.js using webpack

Is it possible to replace the value provided by the Translations provider on application load and load the new XLF file depending on language?

const translations = require("raw-loader!./locale/en-GB.xlf");
const modulePromise = platformBrowserDynamic().bootstrapModule(AppModule,
({
    missingTranslation: MissingTranslationStrategy.Error,
    providers: [
        { provide: TRANSLATIONS, useValue: translations },
        { provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }
    ]
}) as any);
DenizEng
  • 400
  • 4
  • 14

0 Answers0