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

Add Simplified Chinese translation #121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OctoSheep
Copy link

@OctoSheep OctoSheep commented Oct 9, 2024

I have added Simplified Chinese translations to this project.

Please note that there are a lot of variants in Chinese, and the following part of code

hammond/ui/src/i18n.js

Lines 19 to 23 in d5dfe43

const i18n = new VueI18n({
locale: navigator.language.split('-')[0] || 'en',
fallbackLocale: 'en',
messages: loadLocaleMessages()
});

truncates the language code returned by the browser, so it will only get a two-letter language code (similar to ISO 639-1), which means that all Chinese variants will use the strings in the zh.json file.

However, the current standard for language codes is RFC 5646 (also known as BCP 47), which recommends using:

  • zh-Hans-CN or zh-CN for Simplified Chinese used in mainland China
  • zh-Hant-HK or zh-HK for Traditional Chinese used in Hong Kong
  • zh-Hant-TW or zh-TW for Traditional Chinese used in Taiwan

For reference, both Firefox and Chrome that I use return the language code zh-CN.

Unless changes are made to the i18n part of the code, once this commit is merged, users of other Chinese variants will not be able to fully benefit from localization. I say "not fully" because despite the variations in Chinese, the three main variants mentioned above are generally mutually intelligible. Furthermore, many users of Simplified Chinese can understand most Traditional Chinese characters, and vice versa.

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.

1 participant