Skip to content

Commit

Permalink
Update deviceLocales.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
auroursa committed Dec 24, 2024
1 parent 84caa3f commit d2ef00c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/locale/deviceLocales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ export function getLocales() {
}

if (typeof locale.languageTag === 'string') {
if (locale.languageTag === 'zh-CN') {
if (
locale.languageTag.startsWith('zh-Hans') ||
locale.languageTag === 'zh-CN'
) {
// Simplified Chinese to zh-Hans-CN
locale.languageTag = 'zh-Hans-CN'
}
if (locale.languageTag === 'zh-TW') {
if (
locale.languageTag.startsWith('zh-Hant') ||
locale.languageTag === 'zh-TW'
) {
// Traditional Chinese to zh-Hant-TW
locale.languageTag = 'zh-Hant-TW'
}
if (locale.languageTag === 'zh-HK') {
// Traditional Chinese (Hong Kong) to zh-Hant-HK
locale.languageTag = 'zh-Hant-HK'
}
}

// @ts-ignore checked above
Expand Down

0 comments on commit d2ef00c

Please sign in to comment.