diff --git a/ui/src/app/app.component.html b/ui/src/app/app.component.html index 694a691ab..7567b06f7 100644 --- a/ui/src/app/app.component.html +++ b/ui/src/app/app.component.html @@ -20,7 +20,7 @@ aria-expanded="false" ngbDropdownToggle> - Add New + Add
this.messages = m); + this.sub = this.store.select(fromI18n.getMessages).subscribe(m => { + if (m && Object.keys(m).length) { + this.messages = m; + this.update(); + } + }); } update(): void { - this.element.nativeElement.textContent = this.service.translate(this.key, this.currentParams, this.messages); + const translated = this.service.translate(this.key, this.currentParams, this.messages); + this.element.nativeElement.textContent = translated; + // this.element.nativeElement.data = translated; } ngOnDestroy() { diff --git a/ui/src/app/i18n/service/i18n.service.ts b/ui/src/app/i18n/service/i18n.service.ts index 16a613c1f..cc38f0404 100644 --- a/ui/src/app/i18n/service/i18n.service.ts +++ b/ui/src/app/i18n/service/i18n.service.ts @@ -39,6 +39,7 @@ export class I18nService { translate(value: string, interpolated: any, messages: Messages): string { interpolated = interpolated || {}; let val = messages.hasOwnProperty(value) ? messages[value] : value; + console.log(val, messages); return this.interpolate(val, interpolated); }