Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

auroursa
Copy link
Contributor

@auroursa auroursa commented Dec 21, 2024

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 -> zh-Hant-HK

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 like zh-CN. This will be an attempt to fix #6728 without introducing polyfills.

Similar to #6774, tests have shown that zh-Hans-CN, zh-Hant-TW and zh-Hant-HK 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.

The related changes to deviceLocales.ts can refer to #6621, except this time the conversion is reversed: from RFC 1766 to RFC 4646, as browsers still widely use RFC 1766.

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

@auroursa
Copy link
Contributor Author

I have considered directly using zh-Hans and zh-Hant instead of the current more complex expressions, but in my cross-testing, their compatibility wasn't good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Post time in Chinese cannot be localized on Android
1 participant