fix i18n iframe

This commit is contained in:
_Bastler
2022-03-20 14:00:25 +01:00
parent bb857d58cc
commit 95c4be6536
2 changed files with 11 additions and 7 deletions
+6 -5
View File
@@ -3,6 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { environment } from '../../environments/environment';
import { MatPaginatorIntl } from '@angular/material/paginator';
import { Subject, firstValueFrom } from 'rxjs';
import { ActivatedRoute } from '@angular/router';
@Injectable({
providedIn: 'root',
@@ -13,9 +14,8 @@ export class I18nService {
locales: any = [ "de-informal" ];
i18n: any;
constructor(private http: HttpClient) {
}
constructor(private http: HttpClient,
private route: ActivatedRoute) { }
getLocales() {
return this.locales;
@@ -41,7 +41,9 @@ export class I18nService {
let locale = browserLocale || this.locales[ 0 ];
try {
locale = localStorage.getItem("bstly.locale") || locale;
} catch { }
} catch {
locale = window.location.search.split("locale=")[ 1 ];
}
if (locale == 'de') {
locale = 'de-informal';
@@ -59,7 +61,6 @@ export class I18nService {
}
this.setLocale(locale);
}
get(key, args: string[]): string {