-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 #7235
base: main
Are you sure you want to change the base?
Conversation
// Simplified Chinese to zh-CN | ||
locale.languageTag = 'zh-CN' | ||
if ( | ||
locale.languageTag === 'zh-CN' || |
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple zh-Hans
/ zh-Hant
variants on iOS and Android, such as zh-Hans-SG
. We want to match as many of these language variants as possible.
Because it’s unlikely to maintain so many Chinese variants at this stage.
// Traditional Chinese to zh-TW | ||
locale.languageTag = 'zh-TW' | ||
} | ||
if (locale.languageTag.startsWith('yue')) { |
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.
After renaming zh-HK
to yue
, this is no longer needed.
I have considered directly using |
This PR includes the latest translations from Crowdin, and cleans up outdated strings.
Update: We are attempting to convert the language codes for Chinese and Cantonese from RFC-1766 to RFC-4646, to resolve language-related compatibility issues.
The following are the changes:
zh-CN
->zh-Hans-CN
zh-TW
->zh-Hant-TW
zh-HK
->yue
The compatibility issue on Android stems from the differences in Hermes implementation of
Intl
. On Android, it is based on the ICU4j project, which does not include RFC 1766 Chinese language codes likezh-CN
. This will be an attempt to fix #6728 without introducing polyfills.Similar to
ast
#6774,yue
has been proven to be a valid language code for app language. Tests have shown thatzh-Hans-CN
andzh-Hant-TW
can also be correctly used by app language.Since these code changes are all related to Chinese adjustments (including modifications to deviceLocales.ts), I’ve included them in the regular Chinese localization update PR instead of opening a new one. This also helps our translators test the impact of the changes earlier.
Note the impact of changing the language code is limited to the app display language, Cantonese still cannot be used as post language.
Co-maintained by @cirx1e @hakadao @VentusUta