Improved AlfrescoTranslationService

This commit is contained in:
mauriziovitale84
2016-05-19 15:47:05 +01:00
parent 5cb3610888
commit ca6d5725e9
4 changed files with 24 additions and 15 deletions

View File

@@ -79,10 +79,10 @@ export class AppComponent {
let userLang = navigator.language.split('-')[0]; // use navigator lang if available
userLang = /(fr|en)/gi.test(userLang) ? userLang : 'en';
// this language will be used as a fallback when a translation isn't found in the current language
this.translate.setDefaultLang('en');
// the lang to use, if the lang isn't available, it will use the current loader to get them
this.translate.currentLoader.addComponentList('');
this.translate.getTranslation(userLang);
this.translate.use(userLang);
}