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
NativeModules.SettingsManager.settings doesn't have AppleLocale field on iOS 13 #26606
Comments
Also was mentioned in #26540 |
This is also happening to me on react-native version |
It's the same for me but I'm using expo |
I solved my problem with this https://docs.expo.io/versions/v34.0.0/sdk/localization/ |
try this const getDeviceLocale = () => {
if (Platform.OS === 'ios') {
let locale = NativeModules.SettingsManager.settings.AppleLocale // "fr_FR"
if (locale === undefined) {
// iOS 13 workaround, take first of AppleLanguages array ["en", "en-NZ"]
locale = NativeModules.SettingsManager.settings.AppleLanguages[0];
if (locale) {
return locale;
}
}
}
if (Platform.OS === 'android') {
return NativeModules.I18nManager.localeIdentifier;
}
return 'pt-BR';
}; |
@sibelius |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
React Native version:
0.59.9
iOS version on simulator:
13.0
Steps To Reproduce
NativeModules.SettingsManager.settings
object and takeAppleLocale
field from it.en-US
will be returnedUS
.Describe what you expected to happen:
For iOS 12.2 and earlier the
NativeModules.SettingsManager.settings
object containedAppleLocale
field, so everything worked correctly on the same React Native version. I expected that for iOS 13 it will work correctly too.Code example:
The text was updated successfully, but these errors were encountered: