Add Simplified Chinese translation #121
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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
orzh-CN
for Simplified Chinese used in mainland Chinazh-Hant-HK
orzh-HK
for Traditional Chinese used in Hong Kongzh-Hant-TW
orzh-TW
for Traditional Chinese used in TaiwanFor 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.