Skip to content

Conversation

@FantasyCheese
Copy link
Contributor

In CountryCodePicker::getCCPLanguageFromLocale(), currentLocale.getLanguage is not enough to distinguish between Chinese Simplified/Traditional because both have code 'zh' in Language Enum.

Before API 19, there are only two Locale zh_CN / zh_TW, so country is enough to make decision.

After API 19 following Locale options is added:
zh__#Hans,zh_CN_#Hans,zh_HK_#Hans,zh_MO_#Hans,zh_SG_#Hans,zh__#Hant,zh_HK_#Hant,zh_MO_#Hant,zh_TW_#Hant.

Take Hong Kong as an example, it has both Hans and Hant, which stand for Simplified and Traditional respectively, so country is no longer enough, and script part is more accurate.

If other language translations added in the future have same kind of conflict, specifying country and script in Language Enum should work as well.

@hbb20 hbb20 merged commit ba3a637 into hbb20:master Oct 12, 2018
@hbb20
Copy link
Owner

hbb20 commented Oct 12, 2018

Thank you for enhancing CCP... 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants