Skip to content
Snippets Groups Projects
Commit 8da0cdbc authored by Samuel Eickelberg's avatar Samuel Eickelberg
Browse files

Merge remote-tracking branch...

Merge remote-tracking branch 'origin/OP#17992-Sprache-einstellen-anhand-von-Browser-Default-Sprache'
parents ef702a6c b19976a6
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ import { TranslateService } from "@ngx-translate/core"; ...@@ -11,7 +11,7 @@ import { TranslateService } from "@ngx-translate/core";
styleUrls: ['./navigation.component.scss'] styleUrls: ['./navigation.component.scss']
}) })
export class NavigationComponent { export class NavigationComponent {
userLanguage = 'en'; userLanguage = Intl.DateTimeFormat().resolvedOptions().locale.split('-')[0];
fullName = ''; fullName = '';
isInfoDialogVisible = false; isInfoDialogVisible = false;
isSettingsDialogVisible = false; isSettingsDialogVisible = false;
...@@ -24,6 +24,12 @@ export class NavigationComponent { ...@@ -24,6 +24,12 @@ export class NavigationComponent {
); );
constructor(private breakpointObserver: BreakpointObserver, private translate: TranslateService) { 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 { ngOnInit(): void {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment