mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 08:53:48 +01:00
良い感じに
This commit is contained in:
parent
e4e37081ff
commit
4ab19e12b9
1219
locales/ca.yml
1219
locales/ca.yml
File diff suppressed because it is too large
Load Diff
1219
locales/de.yml
1219
locales/de.yml
File diff suppressed because it is too large
Load Diff
1219
locales/en.yml
1219
locales/en.yml
File diff suppressed because it is too large
Load Diff
1219
locales/es.yml
1219
locales/es.yml
File diff suppressed because it is too large
Load Diff
1219
locales/fr.yml
1219
locales/fr.yml
File diff suppressed because it is too large
Load Diff
@ -11,13 +11,13 @@ const loadLang = lang => yaml.safeLoad(
|
||||
const native = loadLang('ja-JP');
|
||||
|
||||
const langs = {
|
||||
'de': loadLang('de'),
|
||||
'en': loadLang('en'),
|
||||
'fr': loadLang('fr'),
|
||||
'ja': native,
|
||||
'de-DE': loadLang('de-DE'),
|
||||
'en-US': loadLang('en-US'),
|
||||
'fr-FR': loadLang('fr-FR'),
|
||||
'ja-JP': native,
|
||||
'ja-KS': loadLang('ja-KS'),
|
||||
'pl': loadLang('pl'),
|
||||
'es': loadLang('es')
|
||||
'pl-PL': loadLang('pl-PL'),
|
||||
'es-ES': loadLang('es-ES')
|
||||
};
|
||||
|
||||
Object.values(langs).forEach(locale => {
|
||||
|
1219
locales/it.yml
1219
locales/it.yml
File diff suppressed because it is too large
Load Diff
1219
locales/ko.yml
1219
locales/ko.yml
File diff suppressed because it is too large
Load Diff
1219
locales/pl.yml
1219
locales/pl.yml
File diff suppressed because it is too large
Load Diff
1219
locales/pt.yml
1219
locales/pt.yml
File diff suppressed because it is too large
Load Diff
1219
locales/ru.yml
1219
locales/ru.yml
File diff suppressed because it is too large
Load Diff
1219
locales/zh.yml
1219
locales/zh.yml
File diff suppressed because it is too large
Load Diff
@ -38,12 +38,18 @@
|
||||
//#endregion
|
||||
|
||||
//#region Detect the user language
|
||||
let lang = navigator.language;
|
||||
let lang = null;
|
||||
|
||||
if (!LANGS.includes(lang)) lang = lang.split('-')[0];
|
||||
if (LANGS.includes(navigator.language)) {
|
||||
lang = navigator.language;
|
||||
} else {
|
||||
lang = LANGS.find(x => x.split('-')[0] == lang);
|
||||
|
||||
// The default language is English
|
||||
if (!LANGS.includes(lang)) lang = 'en';
|
||||
if (lang == null) {
|
||||
// Fallback
|
||||
lang = 'en-US';
|
||||
}
|
||||
}
|
||||
|
||||
if (settings) {
|
||||
if (settings.device.lang) lang = settings.device.lang;
|
||||
|
Loading…
Reference in New Issue
Block a user