joshwcomeau / guppy

🐠A friendly application manager and task runner for React.js
ISC License
3.27k stars 154 forks source link

Update languageCaptions in ApplicationMenu #381

Closed zianke closed 5 years ago

zianke commented 5 years ago

Related Issue: 66

Summary: According to ISO 639-1, "ch" stands for Chamorro and "zh" stands for Chinese. Besides, I find that most apps use the original language for each language caption, for example, "Deutsch" for "de" and "中文" for "zh", so I think we'd better do it here too. What do you think?

image

zianke commented 5 years ago

Thanks for approving the changes @AWolf81 .

Yes I've checked that zh is the code for Chinese in window.navigator.language. One concern might be that there are also zh-cn, zh-tw, etc., just like en-us and en-gb. But as you are using language.startsWith(langCode) in ApplicationMenu, it's not a problem. I think we can make it simple first and add other versions of Chinese translations later.

I agree that src/locale/constants.js is a good location for those two constants, so I've moved them there. If you like it, could you please merge these changes to the i18n-app-menu-item branch, so that I can then merge them to my current local branch on which I'm listing the messages descriptors of all components. Thanks.