In my development environment, the code works fine. But as soon as I build it and push to production, it's failing to compile the app into the correct language
console.log(environment);
if (environment.production) {
enableProdMode();
window.console.log = function () { }; // disable any console.log debugging statements in production mode
}
declare const require;
var translations;
let locationSplit = window.location.hostname.split(".");
console.log(locationSplit);
if (locationSplit[0] == environment.chinese) {
translations = require(`raw-loader!./locale/translatedChinese.zh-Hans.xlf`);
}
else {
translations = null;
}
platformBrowserDynamic().bootstrapModule(AppModule, {
providers: [
{ provide: TRANSLATIONS, useValue: translations },
{ provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }
]
});
I'm console logging the translation file and it's there. But...it's not doing it. Yes, the logic is fine. I've tested it. And like I said, when running locally with webpack, all is well. So I'm confused on what the issue could be. The file is there, the logic is correct, but it still shows up in english :(