diff --git a/CHANGELOG.md b/CHANGELOG.md index ec8a2ae43..910466908 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ the detailed section referring to by linking pull requests or issues. #### Patch +- Fix broken title after i18n + ([#844](https://github.com/sovity/edc-ui/issues/844)) + ### Deployment Migration Notes _No special deployment migration steps required_ diff --git a/src/app/core/services/page-title-strategy.ts b/src/app/core/services/page-title-strategy.ts index be687093d..3d090cd30 100644 --- a/src/app/core/services/page-title-strategy.ts +++ b/src/app/core/services/page-title-strategy.ts @@ -5,7 +5,7 @@ import { RouterStateSnapshot, TitleStrategy, } from '@angular/router'; -import {Subject, switchMap} from 'rxjs'; +import {Subject} from 'rxjs'; import {TranslateService} from '@ngx-translate/core'; @Injectable() @@ -17,9 +17,9 @@ export class CustomPageTitleStrategy extends TitleStrategy { private title: Title, ) { super(); - this.rawTitle$ - .pipe(switchMap((title) => this.translateService.get(title))) - .subscribe((title) => this.title.setTitle(title)); + this.rawTitle$.subscribe((title) => + this.title.setTitle(this.translateService.instant(title)), + ); } override updateTitle(snapshot: RouterStateSnapshot): void {