Skip to content

flash.system.Capabilities.language returns zh-CN instead of zh-TW for Chinese, Traditional on iOS #349

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

Open
jackwlee01 opened this issue Jun 17, 2020 · 5 comments

Comments

@jackwlee01
Copy link

On iPhone 6+ 12.4.2 and iPhone X 13.5.1, using Air 33.1.

In iOS Settings I change my language to Chinese, Traditional.
flash.system.Capabilities.language returns zh-CN instead of zh-TW.

Note that if I set my language to Chinese, Traditional (Hong Kong) flash.system.Capabilities.language appropriately returns zh-TW.

@JohnBlackburne
Copy link

This is definitely a bug flash.system.Capabilities.language has zh-CN for simplified Chinese, zh-TW for traditional Chinese.

But it's confusingly named as the proper language code for simplified Chinese is zh-Hans, for traditional Chinese zh-Hant. Suffixes -CN and -TW can be used to further specify the country; see Language Tags. That is perhaps where the confusion arose. I note that iOS language codes match the proper language codes too.

@ajwfrost
Copy link
Collaborator

Hi

Yes.. the iOS code for Traditional Chinese without a country specifier is coming to us as “zh-hant-US” and its this “US” which causes the AIR logic to fail. We have a fix for it though..

In terms of switching to using zh-Hans and zh-Hant, I agree this is more proper but am concerned we’d see this breaking some apps that rely on the current behaviour... Would be interested by folks’ feedback on this sort of thing!

Thanks

@JohnBlackburne
Copy link

I would not recommend switching to zh-Hant, zh-Hans. I am a bit of a language geek so know the proper codes, but what's there now makes sense as long as it works as documented. I think zh-CN and zh-TW corresponds to the /Resources sub-folder names in an app, so makes sense from that point of view too.

@zwetan
Copy link

zwetan commented Jul 1, 2020

In terms of switching to using zh-Hans and zh-Hant, I agree this is more proper but am concerned we’d see this breaking some apps that rely on the current behaviour... Would be interested by folks’ feedback on this sort of thing!

see Move zh-tw and zh-cn locales to zh-hant and zh-hans, respectively
and Full backwards compatibility for old language codes

imho zh-hant and zh-hans should be added while still supporting zh-tw and zh-cn for backward compatibility

@JohnBlackburne
Copy link

I don't think you could add zh-Hant and zh-Hans without breaking existing code which checks for and expects zh-TW and zh-CN.

And I think you can get correct and more detailed locale information from flash.system.Capabilities.languages. In particular the first element of the array returned by languages should be the OS supplied version of the user's preferred locale, so zh-Hant-HK or whatever it is.

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

No branches or pull requests

4 participants