Retranslate sidebar on lang change

This commit is contained in:
Sven Heidemann 2023-03-06 08:39:56 +01:00
parent d1420d18c0
commit 21f0f32322

View File

@ -3,7 +3,7 @@ import { MenuItem } from "primeng/api";
import { BehaviorSubject } from "rxjs"; import { BehaviorSubject } from "rxjs";
import { AuthRoles } from "../../models/auth/auth-roles.enum"; import { AuthRoles } from "../../models/auth/auth-roles.enum";
import { AuthService } from "../auth/auth.service"; import { AuthService } from "../auth/auth.service";
import { TranslateService } from "@ngx-translate/core"; import { LangChangeEvent, TranslateService } from "@ngx-translate/core";
import { NavigationEnd, Router } from "@angular/router"; import { NavigationEnd, Router } from "@angular/router";
import { ThemeService } from "../theme/theme.service"; import { ThemeService } from "../theme/theme.service";
import { Server } from "../../models/data/server.model"; import { Server } from "../../models/data/server.model";
@ -41,7 +41,7 @@ export class SidebarService {
}); });
this.translateService.onLangChange.subscribe(_ => { this.translateService.onLangChange.subscribe(_ => {
this.setMenu(); this.setMenu(true);
}); });
this.router.events.subscribe(event => { this.router.events.subscribe(event => {