-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Chinese & Cantonese localization #7174
Changes from all commits
1285e52
1a21352
ba7a077
6eec169
11cef81
91e6542
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,17 +41,23 @@ export function getLocales() { | |
} | ||
|
||
if (typeof locale.languageTag === 'string') { | ||
if (locale.languageTag.startsWith('zh-Hans')) { | ||
// Simplified Chinese to zh-CN | ||
locale.languageTag = 'zh-CN' | ||
if ( | ||
locale.languageTag === 'zh-CN' || | ||
locale.languageTag.startsWith('zh-Hans') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are multiple |
||
) { | ||
// Simplified Chinese to zh-Hans | ||
locale.languageTag = 'zh-Hans-CN' | ||
} | ||
if (locale.languageTag.startsWith('zh-Hant')) { | ||
// Traditional Chinese to zh-TW | ||
locale.languageTag = 'zh-TW' | ||
if ( | ||
locale.languageTag === 'zh-TW' || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the same reason as above—browser compatibility. |
||
locale.languageTag.startsWith('zh-Hant') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
) { | ||
// Traditional Chinese to zh-Hant | ||
locale.languageTag = 'zh-Hant-TW' | ||
} | ||
if (locale.languageTag.startsWith('yue')) { | ||
// Cantonese (Yue) to zh-HK | ||
locale.languageTag = 'zh-HK' | ||
// Cantonese (Yue) to yue | ||
locale.languageTag = 'yue' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To match the two variants on Android and iOS: Not using |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To ensure browser compatibility, as browsers still widely use RFC-1766.