良い感じに

This commit is contained in:
syuilo 2018-08-23 01:37:05 +09:00
parent 4153b0db38
commit 8dc9ec06f8
13 changed files with 16 additions and 13419 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -11,13 +11,13 @@ const loadLang = lang => yaml.safeLoad(
const native = loadLang('ja-JP'); const native = loadLang('ja-JP');
const langs = { const langs = {
'de': loadLang('de'), 'de-DE': loadLang('de-DE'),
'en': loadLang('en'), 'en-US': loadLang('en-US'),
'fr': loadLang('fr'), 'fr-FR': loadLang('fr-FR'),
'ja': native, 'ja-JP': native,
'ja-KS': loadLang('ja-KS'), 'ja-KS': loadLang('ja-KS'),
'pl': loadLang('pl'), 'pl-PL': loadLang('pl-PL'),
'es': loadLang('es') 'es-ES': loadLang('es-ES')
}; };
Object.values(langs).forEach(locale => { Object.values(langs).forEach(locale => {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -38,12 +38,18 @@
//#endregion //#endregion
//#region Detect the user language //#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 (lang == null) {
if (!LANGS.includes(lang)) lang = 'en'; // Fallback
lang = 'en-US';
}
}
if (settings) { if (settings) {
if (settings.device.lang) lang = settings.device.lang; if (settings.device.lang) lang = settings.device.lang;