-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Consider rename Chinese translations from zh-cn/zh-tw style to zh-Hans/zh-Hant #793
Comments
I don't see this requirement has anything to do with the code. I couldn't find anything on Hugo's docs that says localized date and time should use Can you maybe cite your source for this information? Anyway, I did find this snippet on Hugo's forum, which seems like what you're trying to achieve. Hope this helps. |
Hi, sorry for not having cited the source. Localization of datetime string (also currencies, etc) is done in this pkg https://github.com/gohugoio/locales , and language code for chinese is in zh-Hans/zh-Hant format. #805 btw, in this pr, zh-han should be renamed to zh-hans to conform to the code used in gohugoio/locales |
Ok, I ran some tests and can confirm this does in fact interfere with how Hugo renders dates and times. However, I want to propose that we should change In addition, we may want to add some documentation to hint to future translation contributors that they should use codes available in gohugoio/locales so we won't bump into the same issue again. |
True. This is really a common mistake because most websites use zh-cn as the de facto language code for Chinese(simplified) although w3c suggests zh-Hans (https://www.w3.org/International/articles/language-tags/ ). Plus there are also styles like zh-cmn (same for zh-Hans), and it is really a little messy here.
As per my experience, zh-Hans (the simplified version of Chinese) is normally consistent among its usage regions (China Mainland, Macau and Singapore), there are slight differences for zh-Hant (traditional Chinese) between the Hong Kong dialect (which includes words and phrases in Cantonese) and the rest of its usage. Since current translations have only two of them, zh-Hans and zh-Hant naming should be enough because most language processors will fallback to these two and we can create regional translations when we have them. |
Hmm...that's different from my experience. I cloned a copy of gohugoio/locales and dug into all
As the author of In this case, I would say that we create four translations: |
This is definitely a topic where I do not have relevant knowledge or experience to make a call on the best way forward. My only concern is that the codes chosen work with Hugo and don't cause any implementation issues but it seems like that is not a problem with this issue. |
@tomy0000000 Ofc, it would be best to have the separated. Since we currently have not authors for other dialects, we may put up a notice so that people using other dialects could use fallback ones. |
@jpanther Hi! As for |
I'm happy with the proposal to use |
Sounds good to me, let me know if you need help with this. |
Looking at this in more detail now, I'm already confused due to my lack of understanding of the dialects involved. Is the plan then to duplicate @tomy0000000 I might need to take you up on your offer to help with this! |
Yes
Users who prefer a translation localized to China's custom can choose
Yes, that's also the case. I'm willing to work on this, but I'm a bit busy for the next couple of days, so please allow me to take on this about 2 to 3 days later. |
I'm happy to do simple move and replace, the part I'm confused about is what changes need to be made to distinguish between |
I guess what I'm proposing is, would this be sufficient? ie. making 2 copies of each of the existing translations...
|
Yes, this should be sufficient at the moment |
I've started a PR for this and have made the changes above. Have a look and let me know if you think this is sufficient. |
Language
Chinese
What's the issue?
In Hugo's i18n processor (used for i18n datetime string), language code for Chinese is in zh-Hans/zh-Hant style and Congo's i18n config file names are in zh-CN/zh-TW style. This creates a discrepancy in user's language code selection and results in the following scenerio:
where datetime(which is handled by hugo) is in English and other stuff like word count (which are handled by congo) are in chinese.
Theme version
main
Hugo version
latest
Relevant Hugo log output
No response
The text was updated successfully, but these errors were encountered: