-
Notifications
You must be signed in to change notification settings - Fork 23
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
iOS await Devicelocale.currentAsLocale always return 'en' and correct CountryCode #38
Comments
I have the same problem, does anyoone have a fix for this? |
The answer above from @tdujmic (adding the app supported languages into the Info.plist) should work. |
no, it does not work. the problem is that the returned locale is wrong if the locale is not in the array. and I want to get the correct device locale even if it's not in the supported locales because I want to show english as fallback. with the example above, if I change the language to spanish, the plugin returns 'de' as the currentLocale which is not correct. |
The plugin was designed to return the locales supported by the app if the app was developed in various languages (i.e. it shows which languages the app has been created for) . Can you let me know you default locale (region) set on the phone, The list of preferred languages you have set up and the content of your info.plist. I will try and replicate and have a look at the issue. Thanks. |
ok, then I didn't get that from the description in pub.dev. My use case is to get the actual locale of the device in main() to set the locale for the first app start. And I can't use Localizations.of(context) there yet. my info.plist I tried it on an iOS simulator and set the region and language to Spain, 'es_ES', but the plugin shows 'de_ES'. |
@josefwilhelm-innio |
@magnatronus after this fix do we still need to set |
If you currently use it for anything then yes, the update just gives you the first language and region. |
Since iOS 15 is launched this issue is presented. Yesterday I saw that only adding array of supported languages into Info.plist
helps a bit, but for all other languages presented on phone which are not in Info.plist it returns 'en' for language.
I repeat that only happens on iOS 15.x
I added this in Info.plist and my languages are returned correctly now, but any other selected on iPhone returns 'en' if is not in Info.plist again for eg my local language 'hr' is returned as 'en' :
The text was updated successfully, but these errors were encountered: