fix: zh-Hans i18n fails on page reload (#1092)

Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
zqran
2023-02-17 14:47:49 +08:00
committed by GitHub
parent 25ac0f700b
commit 590ff6ffa7
2 changed files with 2 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ const resources = LOCALES.reduce<Resource>(
const fallbackLng = 'en';
const standardizeLocale = (language: string) => {
if (language === 'zh-CN' || language === 'zh') {
if (language === 'zh-CN' || language === 'zh' || language === 'zh-Hans') {
language = 'zh-Hans';
} else if (language.slice(0, 2).toLowerCase() === 'zh') {
language = 'zh-Hant';