diff --git a/lib/core/services/translation.service.ts b/lib/core/services/translation.service.ts index 5fc84e4c49..8fcb2e6a5d 100644 --- a/lib/core/services/translation.service.ts +++ b/lib/core/services/translation.service.ts @@ -75,6 +75,7 @@ export class TranslationService { this.translate.getTranslation(this.userLang).subscribe( () => { this.translate.use(this.userLang); + this.onTranslationChanged(this.userLang); } ); }); @@ -82,12 +83,20 @@ export class TranslationService { this.translate.getTranslation(this.userLang).subscribe( () => { 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. * @param lang Code name for the language