fix iframe locale

This commit is contained in:
_Bastler 2022-03-20 11:33:12 +01:00
parent 4c11c4d9e6
commit d68060b3fb

View File

@ -31,7 +31,13 @@ export class I18nService {
async fetch() { async fetch() {
let browserLocale = navigator.language; await this.http.get(environment.apiUrl + "/i18n").subscribe({
next: (data: any) => {
this.locales = data;
}, error: (error) => { }
});
let browserLocale = window.navigator.language || window.parent.navigator.language;
if (browserLocale.indexOf("-") != -1) { if (browserLocale.indexOf("-") != -1) {
browserLocale = browserLocale.split("-")[ 0 ]; browserLocale = browserLocale.split("-")[ 0 ];
@ -46,12 +52,6 @@ export class I18nService {
locale = 'de-informal'; locale = 'de-informal';
} }
await this.http.get(environment.apiUrl + "/i18n").subscribe({
next: (data: any) => {
this.locales = data;
}, error: (error) => { }
});
if (this.locales.indexOf(locale) == -1) { if (this.locales.indexOf(locale) == -1) {
locale = this.locales[ 0 ]; locale = this.locales[ 0 ];
} }