commit
1ed189a518
|
@ -15,7 +15,7 @@ const langs = {
|
||||||
'en': loadLang('en'),
|
'en': loadLang('en'),
|
||||||
'fr': loadLang('fr'),
|
'fr': loadLang('fr'),
|
||||||
'ja': native,
|
'ja': native,
|
||||||
'ja-ks': loadLang('ja-ks'),
|
'ja-KS': loadLang('ja-KS'),
|
||||||
'pl': loadLang('pl'),
|
'pl': loadLang('pl'),
|
||||||
'es': loadLang('es')
|
'es': loadLang('es')
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,13 +32,15 @@
|
||||||
//#region Detect app name
|
//#region Detect app name
|
||||||
let app = null;
|
let app = null;
|
||||||
|
|
||||||
if (url.pathname == '/docs' || url.pathname.startsWith('/docs/')) app = 'docs';
|
if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs';
|
||||||
if (url.pathname == '/dev' || url.pathname.startsWith('/dev/')) app = 'dev';
|
if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev';
|
||||||
if (url.pathname == '/auth' || url.pathname.startsWith('/auth/')) app = 'auth';
|
if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth';
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Detect the user language
|
//#region Detect the user language
|
||||||
let lang = navigator.language.split('-')[0];
|
let lang = navigator.language;
|
||||||
|
|
||||||
|
if (!LANGS.includes(lang)) lang = lang.split('-')[0];
|
||||||
|
|
||||||
// The default language is English
|
// The default language is English
|
||||||
if (!LANGS.includes(lang)) lang = 'en';
|
if (!LANGS.includes(lang)) lang = 'en';
|
||||||
|
|
Loading…
Reference in New Issue