#will-reactnative-localization

1 messages · Page 1 of 1 (latest)

glacial eagleBOT
clear stratus
#

@true sorrel on iOS the phone's locale isn't enough, you need a custom configuration file called Info.plist for it to work too.

true sorrel
#

I tried adding additional data to app.json (as the application is built in Expo), however it didn't solve the problem

clear stratus
#

will-reactnative-localization

#

@true sorrel you said "I tried" but you tried what exactly?

glacial eagleBOT
true sorrel
#

To be more precise, I added the following to app.json file:
"infoPlist": {
"CFBundleAllowMixedLocalizations": true,
"CFBundleLocalizations" : ["pl"],
"CFBundleDevelopmentRegion" : "pl"
}
I also tried creating empty pl.json file and adding the following to app.json:
"locales": {
"pl": "./locales/pl.json"
}
as some posts on StackOverflow suggest, but Payment Sheet is still rendered in English

nimble widget
#

Hello! I'm taking over and catching up...

#

To clarify, are you trying to force the Payment Sheet to be in a specific language all the time, or do you want it to use the locale set on the device?

true sorrel
#

I would like it to use the locale set on the device

#

However, I tried to set at least to Polish, as the primary application language is Polish

nimble widget
#

On the device you're testing with do you have Polish added here in Settings -> System -> Languages & Input -> Languages?

true sorrel
#

Give me a minute, I will check

#

I have set Polish in settings: General => Language and Region

nimble widget
#

Can you view the generated Info.plist file to make sure the keys and values are being set as expected?

true sorrel
#

In Expo I do not have access to Info.plist file, I do have the code I pasted above in app.json file

#

Maybe I am missing something else?

nimble widget
#

Right, but Expo has to generate that file during the build process, you can't access it?

true sorrel
#

I am not sure how to access that. The build is also made using expo cli

nimble widget
#

Can you completely clean and remove the build and regenerate it from scratch? It seems like an old value or old version of the file is sticking around.

#

And remove it from the device entirely and reinstall it?

true sorrel
#

Yes, I can do that. In case I run the application locally, will the language changes also apply?

nimble widget
#

What do you meany by locally?

true sorrel
#

I mean using Expo application, without generating development build

nimble widget
#

It sounds like this is an iOS-specific issue, right? In which case you would need to test in the iOS simulator or an iOS device.

true sorrel
#

Yes, I test it on iOS device, using expo application and using generated development build