This commit is contained in:
Lurkars
2021-01-12 19:29:00 +01:00
parent b7b4e2d032
commit 997a512e00
96 changed files with 2711 additions and 304 deletions
+11 -1
View File
@@ -8,6 +8,7 @@ import { isEmpty } from 'rxjs/operators';
export class I18nService {
locale: String;
locales = ["de-informal"];
i18n: any;
constructor(private http: HttpClient) {
@@ -17,15 +18,24 @@ export class I18nService {
browserLocale = browserLocale.split("-")[0];
}
let locale = localStorage.getItem("bstly.locale") || browserLocale || 'en';
let locale = localStorage.getItem("bstly.locale") || browserLocale || this.locales[0];
if (locale == 'de') {
locale = 'de-informal';
}
if (this.locales.indexOf(locale) == -1) {
locale = this.locales[0];
}
this.setLocale(locale);
}
getLocales() {
return this.locales;
}
getLocale() {
return this.locale;
}