Skip to content
Snippets Groups Projects
Commit b19976a6 authored by Jannes Welle's avatar Jannes Welle
Browse files

OP#17992 added automatic translation to default browser Language

parent c77e4bed
No related branches found
No related tags found
No related merge requests found
Pipeline #58608 canceled
......@@ -11,7 +11,7 @@ import { TranslateService } from "@ngx-translate/core";
styleUrls: ['./navigation.component.scss']
})
export class NavigationComponent {
userLanguage = 'en';
userLanguage = Intl.DateTimeFormat().resolvedOptions().locale.split('-')[0];
fullName = '';
isInfoDialogVisible = false;
isSettingsDialogVisible = false;
......@@ -24,6 +24,12 @@ export class NavigationComponent {
);
constructor(private breakpointObserver: BreakpointObserver, private translate: TranslateService) {
if (this.translate.langs.includes(this.userLanguage)) {
this.translate.use(this.userLanguage);
}else{
this.userLanguage = 'en';
this.translate.use('en');
}
}
ngOnInit(): void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment