From 44dff73b244b45c16cd42ab3e19c0282f48bf276 Mon Sep 17 00:00:00 2001 From: Xeltica Date: Thu, 23 Jun 2022 00:14:06 +0900 Subject: [PATCH] =?UTF-8?q?=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E8=A8=80=E8=AA=9E=E5=90=8D=E3=81=8C=E8=A8=AD=E5=AE=9A=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E5=A0=B4=E5=90=88=E3=80=81?= =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/init.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/init.tsx b/src/frontend/init.tsx index e9c3337..6041ad0 100644 --- a/src/frontend/init.tsx +++ b/src/frontend/init.tsx @@ -5,7 +5,7 @@ import dayjs from 'dayjs'; import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; -import { getBrowserLanguage, resources } from './langs'; +import { getBrowserLanguage, languageName, resources } from './langs'; import { App } from './App'; import { LOCALSTORAGE_KEY_LANG } from './const'; @@ -17,7 +17,7 @@ dayjs.extend(relativeTime); let lng = localStorage[LOCALSTORAGE_KEY_LANG]; -if (!lng) { +if (!lng || !Object.keys(languageName).includes(lng)) { lng = localStorage[LOCALSTORAGE_KEY_LANG] = getBrowserLanguage(); }