android - Simplified and Traditional Chinese vs Regions -


in process of implementing traditional , simplified chinese support in android application , confused on how supposed work.

so reading documentation discussions this , this have put simplified chinese

  • values-zh
  • values-zh-rcn
  • values-zh-rsg

and traditional chinese

  • values-zh-rtw
  • values-zh-rhk

that works fine somehow not make sense me (sorry if dont understand enough chinese simplified vs traditional usage).

from understand checking locale setting dialog in emulator on rooted phone user can change locale simplified chinese or traditional chinese.

now here question. how system know simplified or traditional chinese strings.xml. there sort of assumption baked in says if supposed display simplified chinese values-zh , traditional values-zh-rtw?

but if user located in hk , set device display simplified chinese? or if emigrant somewhere else in world sets device traditional chinese region e.g. or ca?

what have allow users set locale , have app appear right locale?

update:

from further investigation believe android phone user can not set country separately language. can set called locale in ui. consists of language , country, list limited many combinations not possible.

e.g. chinese person living in wants use traditional chinese set language traditional chinese (at least on rooted phone) , have locale of zh-rtw. in no way set country separately us. in similar manner sort of emigrant can not set native language country live in..

basically means bunch of combinations of language , country supported. questions how find out ones are?

so think after further investigation , marks answer going provide answer myself. here goes:

out of box android has 2 locales zh_rcn, simplified chinese , zh_rtw, traditional chinese. can see settings app these supplied locales:

https://android.googlesource.com/platform/packages/apps/settings/+/master/res/

however other creator of android system e.g. phone sold in china or change add. overall theoretically supported set can found looking @ list of locales found in icu4c app:

https://android.googlesource.com/platform/external/icu4c.git/+/master/data/locales/ can see chinese there

  • zh.txt
  • zh_cn.txt
  • zh_hk.txt
  • zh_hans.txt
  • zh_hans_cn.txt
  • zh_hans_hk.txt
  • zh_hans_mo.txt
  • zh_hans_sg.txt
  • zh_hant.txt
  • zh_hant_hk.txt
  • zh_hant_mo.txt
  • zh_hant_tw.txt
  • zh_mo.txt
  • zh_sg.txt
  • zh_tw.txt

hant iso code traditional , hans simplified chinese. theoretically mean have

  • simplified chinese in china, hongkong, macau , singapore
  • traditional chinese in hongkong, macau , taiwan

however keep in mind settings app have modified have different selections of locale. @ stage simplified chinese translates zh_rcn , traditional zh_rtw , should apart users have such modified android image supports other locales.

in case on save side can use configuration class locale e.g. in application class getresources().getconfiguration().locale.

you e.g. log , send data tracking system (whatever use) or check supported ones , throw exception locale setting in message , show in market interface... mean minimum of 1 crash of app (if on ball can publish , update few minutes later ..)

so recap .. minimum setup mirroring done in settings app (only have zh-rcn , zh-rtw), if want provide default locales singapore, hongkong, macau supplying traditional chinese default can , should work. have no evidence such configuration used anywhere..

hope helps.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -