Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit fcf38966 authored by Sebastian-Ion TINCU's avatar Sebastian-Ion TINCU
Browse files

EDELIVERY-13873 Internationalization User Role Translation is not Working Properly

Update the user role when the language changes in other components (e.g. when the user locale is updated).
parent aaa86793
Branches
Tags
No related merge requests found
Pipeline #219911 failed
......@@ -29,7 +29,8 @@ export class ToolbarComponent implements OnDestroy{
fullMenu: boolean = true;
userController: UserController;
currentUserRoleDescription = "";
private sub: Subscription;
private loginSubscription: Subscription;
private languageChangeSubscription: Subscription;
constructor(private alertService: AlertMessageService,
private securityService: SecurityService,
......@@ -41,11 +42,13 @@ export class ToolbarComponent implements OnDestroy{
private translateService: TranslateService) {
this.userController = new UserController(this.http, this.lookups, this.dialog);
this.sub = this.securityEventService.onLoginSuccessEvent().subscribe(async user => await this.updateCurrentUserRoleDescription());
this.loginSubscription = this.securityEventService.onLoginSuccessEvent().subscribe(async user => await this.updateCurrentUserRoleDescription());
this.languageChangeSubscription = this.translateService.onLangChange.subscribe(async langChangeEvent => await this.updateCurrentUserRoleDescription());
}
ngOnDestroy() {
this.sub.unsubscribe();
this.loginSubscription.unsubscribe();
this.languageChangeSubscription.unsubscribe();
}
clearWarning() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment