Skip to content
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

Inconsistency in languageName causing Traditional Chinese (TW) to fail switching correctly. #101

Open
EanLee opened this issue Mar 9, 2023 · 1 comment

Comments

@EanLee
Copy link

EanLee commented Mar 9, 2023

When using intl_utils:generate to generate messages_{language}.dart for Traditional Chinese (TW), the language code in Dart is 'zh_Hant-TW'. However, when the Android system language is Traditional Chinese (TW), the language code passed to the initializeMessages method in messages_all.dart is 'zh_Hant_TW', causing an issue with language switching. This problem is likely due to a difference in language codes between Dart and the Android system.

The red box is the languageName of the system
The yellow box is the languageName created by intl_utils:generate

image

@lzoran
Copy link
Collaborator

lzoran commented Oct 11, 2023

Thank you for pointing this out!

It seems this might be related to the issue discussed here. The root of the problem appears to be with Intl.canonicalizedLocale from the intl package, which isn't handling locale strings with script code appropriately.

Temporary Fix: You could try setting the locale metadata to "@@locale": "zh_Hant_TW" in your .arb file for Traditional Chinese (Taiwan). This should temporarily fix this problem until we find a better solution.

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

2 participants