Code development platform for open source projects from the European Union institutions

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

EDELIVERY-13873 Internationalization User Role Translation is not Working Properly

Manually set the language upon logging in instead of relying on the asynchronous notification.
parent f6eb0105
No related branches found
No related tags found
No related merge requests found
Pipeline #214824 failed
......@@ -40,8 +40,6 @@ export class LoginComponent implements OnInit, OnDestroy {
loading = false;
returnUrl: string;
sub: Subscription;
localeSub: Subscription;
constructor(private route: ActivatedRoute,
private router: Router,
......@@ -91,8 +89,6 @@ export class LoginComponent implements OnInit, OnDestroy {
}
});
this.localeSub = this.securityEventService.onLoginSuccessEvent().subscribe(user => user && this.translateService.use(user.smpLocale));
this.securityEventService.onLoginErrorEvent().subscribe(
async error => {
let message;
......@@ -176,7 +172,6 @@ export class LoginComponent implements OnInit, OnDestroy {
ngOnDestroy(): void {
this.sub.unsubscribe();
this.localeSub.unsubscribe();
}
isUserAuthSSOEnabled(): boolean {
......
......@@ -50,6 +50,7 @@ export class SecurityService {
.subscribe({
next: (response: User) => {
this.updateUserDetails(response);
this.translateService.use(response?.smpLocale);
this.securityEventService.notifyLoginSuccessEvent(response);
},
error: (error: any) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment