cordova-plugin-globalization
cordova-plugin-globalization copied to clipboard
iOS - getLocaleName return `en-FR` when the phone is actually in `fr-FR`
On iOS, getLocaleName
return en-FR
when the phone is actually in fr-FR
.
Tested with cordova-plugin-globalization 1.11.0 "Globalization"
.
I've found the cause of this issue. Since iOS 11, [NSLocale currentLocale]
will return the actual system lang only if the app has listed its supported locales in its *-info.plist
file under the key:
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>fr</string>
<string>nl</string>
<string>it</string>
<string>de</string>
</array>
I think that should be written in the cordova-plugin-globalization
README file as an iOS specificity...
Awesome find! Could you please create a PR for this in the README?
Would be great if it would also include a link to some source about this on an Apple website.
Ow this is why! Been wondering for a long time why my language was not as it should be... +1 for the README suggestion.
Works after adding the following to the
<custom-config-file parent="CFBundleLocalizations" platform="ios" target="*-Info.plist"> <array> <string>en</string> <string>fr</string> </array> </custom-config-file>
We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution.