i18n fixes (#3018)

This commit is contained in:
Denys Vuika
2018-03-01 13:39:12 +00:00
committed by GitHub
parent cef05cbcb9
commit 73720d8975

View File

@@ -75,6 +75,7 @@ export class TranslationService {
this.translate.getTranslation(this.userLang).subscribe( this.translate.getTranslation(this.userLang).subscribe(
() => { () => {
this.translate.use(this.userLang); this.translate.use(this.userLang);
this.onTranslationChanged(this.userLang);
} }
); );
}); });
@@ -82,12 +83,20 @@ export class TranslationService {
this.translate.getTranslation(this.userLang).subscribe( this.translate.getTranslation(this.userLang).subscribe(
() => { () => {
this.translate.use(this.userLang); this.translate.use(this.userLang);
this.onTranslationChanged(this.userLang);
} }
); );
} }
} }
} }
private onTranslationChanged(lang: string): void {
this.translate.onTranslationChange.next({
lang: lang,
translations: this.customLoader.getFullTranslationJSON(lang)
});
}
/** /**
* Sets the target language for translations. * Sets the target language for translations.
* @param lang Code name for the language * @param lang Code name for the language