mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-27 00:13:03 +00:00
Optimize booting script
This commit is contained in:
parent
f3ab8199a5
commit
4dc8351f56
1 changed files with 5 additions and 3 deletions
|
@ -18,6 +18,8 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const langs = LANGS;
|
||||||
|
|
||||||
//#region Load settings
|
//#region Load settings
|
||||||
let settings = null;
|
let settings = null;
|
||||||
const vuex = localStorage.getItem('vuex');
|
const vuex = localStorage.getItem('vuex');
|
||||||
|
@ -40,10 +42,10 @@
|
||||||
//#region Detect the user language
|
//#region Detect the user language
|
||||||
let lang = null;
|
let lang = null;
|
||||||
|
|
||||||
if (LANGS.includes(navigator.language)) {
|
if (langs.includes(navigator.language)) {
|
||||||
lang = navigator.language;
|
lang = navigator.language;
|
||||||
} else {
|
} else {
|
||||||
lang = LANGS.find(x => x.split('-')[0] == navigator.language);
|
lang = langs.find(x => x.split('-')[0] == navigator.language);
|
||||||
|
|
||||||
if (lang == null) {
|
if (lang == null) {
|
||||||
// Fallback
|
// Fallback
|
||||||
|
@ -52,7 +54,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings && settings.device.lang &&
|
if (settings && settings.device.lang &&
|
||||||
LANGS.includes(settings.device.lang)) {
|
langs.includes(settings.device.lang)) {
|
||||||
lang = settings.device.lang;
|
lang = settings.device.lang;
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
Loading…
Reference in a new issue