Updated spanish translation xliff and json

locale is now retrieved from cookies
This commit is contained in:
Isaac Grynsztein
2020-03-15 03:58:31 -04:00
parent c17d29075e
commit ddcd1d0772
6 changed files with 2097 additions and 302 deletions

View File

@@ -12,18 +12,16 @@ if (environment.production) {
enableProdMode();
}
// const locale = localStorage.getItem('locale');
getTranslations('assets/i18n', false, true, true, 'en', null, 'locale').then(translations => {
if (translations) {
loadTranslations(translations);
}
import('./app/app.module').then(module =>
{
platformBrowserDynamic()
.bootstrapModule(module.AppModule)
.catch(err => console.error(err));
});
const locale = localStorage.getItem('locale');
if (locale) {
fetch(`./assets/i18n/messages.${locale}.json`).then(res => res.json()).then((resp) => {
console.log(resp);
loadTranslations(resp);
platformBrowserDynamic().bootstrapModule(AppModule);
}, err => {
platformBrowserDynamic().bootstrapModule(AppModule);
});
platformBrowserDynamic().bootstrapModule(AppModule);
} else {
console.log('no locale');
platformBrowserDynamic().bootstrapModule(AppModule);
}