In the process of implementing traditional and simplified chinese support in my Android application and I confused on how this is supposed to work.
So from reading the documentation
as well as some discussions like this and this I have put simplified chinese into
- values-zh
- values-zh-rCN
- values-zh-rSG
and traditional chinese into
- values-zh-rTW
- values-zh-rHK
That all works fine but somehow does not make sense to me (sorry if I dont understand enough about chinese simplified vs traditional usage).
From what I understand from checking the locale setting dialog in the emulator as well as on a rooted phone a user can change the locale to Simplified Chinese or Traditional Chinese.
Now here is the question. How does the system know where to get the simplified or traditional chinese strings.xml. Is there some sort of assumption baked in that says if I am supposed to display simplified chinese get it from values-zh and get traditional from values-zh-rTW?
But what if a user is located in HK and set his device up to display simplified chinese? Or what if an emigrant somewhere else in the world sets his device to traditional chinese but his region is e.g. US or CA?
What do I have to do to allow my users to set their locale and have my app appear with the right locale?
Update:
From further investigation I believe that a Android phone user can not set the country separately from the language. They can only set what is called the locale in the UI. It consists of language and country, but the list is limited so many combinations are not possible.
E.g. a Chinese person living in the US that wants to use Traditional Chinese could set the language to traditional chinese (at least on a rooted phone) and would then have a locale of zh-rTW. He could in no way set his country separately to be US. In a similar manner any sort of emigrant can not set their native language with the country they currently live in..
Basically that means that only a bunch of combinations of language and country are supported. Now the questions is how to find out which ones they are?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…