From c0fecda18b040f15d406181983426c4ea4060d38 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 23 Aug 2018 01:55:39 +0900 Subject: [PATCH] Fix bug --- src/client/app/boot.js | 2 +- src/misc/i18n.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 6bcceec21..86d48faf1 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -43,7 +43,7 @@ if (LANGS.includes(navigator.language)) { lang = navigator.language; } else { - lang = LANGS.find(x => x.split('-')[0] == lang); + lang = LANGS.find(x => x.split('-')[0] == navigator.language); if (lang == null) { // Fallback diff --git a/src/misc/i18n.ts b/src/misc/i18n.ts index a07af3e93..8379b2f53 100644 --- a/src/misc/i18n.ts +++ b/src/misc/i18n.ts @@ -30,7 +30,7 @@ export default class Replacer { if (text.hasOwnProperty(path)) { text = text[path]; } else { - if (this.lang === 'ja') console.warn(`path '${path}' not found`); + if (this.lang === 'ja-JP') console.warn(`path '${path}' not found`); return key; // Fallback } } @@ -46,10 +46,10 @@ export default class Replacer { }); if (error) { - if (this.lang === 'ja') console.warn(`key '${key}' not found in '${path}'`); + if (this.lang === 'ja-JP') console.warn(`key '${key}' not found in '${path}'`); return key; // Fallback } else if (typeof text !== 'string') { - if (this.lang === 'ja') console.warn(`key '${key}' is not string in '${path}'`); + if (this.lang === 'ja-JP') console.warn(`key '${key}' is not string in '${path}'`); return key; // Fallback } else { return text;