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

@@ -6,7 +6,7 @@ on:
paths: paths:
- 'packages/i18n/**' - 'packages/i18n/**'
- '.github/workflows/languages-sync.yml' - '.github/workflows/languages-sync.yml'
pull_request: pull_request_target:
branches: ['master'] branches: ['master']
paths: paths:
- 'packages/i18n/**' - 'packages/i18n/**'

View File

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