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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

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

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';