React Native Plugin Localisation iOS

Hello!

Is there a way to add Localisation strings in a React Native project on iOS? I followed this tutorial https://developer.squareup.com/docs/in-app-payments/localize-ios but it doesn’t work in my React Native project. Texts are still not translated.

Also: is there a way to customize the Save Button background colour when it’s not active (not the tintColor)? In dark mode the button is black and it doesn’t fit my app UI.

Thanks

Hi @kbarralon welcome to the forums!

I believe once you follow those steps, your phone/device also needs to be set to the corresponding language before it will take affect. Is your phone set to a different language?

I don’t believe there is a way to change the background color at this time unfortunately (at least not when it’s disabled).

Thanks for the answer.

Yes, my phone is in French Canada and I cannot see localized texts in the SDK when I launch Square payment flow while I have my app translated. Here a screenshot of the Xcode config. We can see we have “0 files localized”.

Can you confirm that SquareInAppPaymentsSDK.framework is embedded under “Targets”->“General”->“Frameworks, Libraries, and Embedded Content”? Even without other languages, my “Base” says “1 Files Localized” so that seems weird that it’s not working.

I use Cocoapods . Is there another thing I need to do in addition to the indications in documentation?

No, that should be all. Is the In-App Payments SDK actually working, though? Can you successfully open the payment form etc? I just want to make sure it’s successfully installed before diving deeper into the localization issue.

yep, everything is working fine. On both iOS and Android. On Android, I have translations but not on iOS.

Ah, I think I found the issue. In the quickstart I’m using it has a launch screen resource file, which when adding localizations it makes me choose that. I checked in with some iOS engineers and I believe a launch screen is required to be localized. Can you try creating a launch screen resource file, and then when you add the localization it should ask you to choose a file (and the launch screen should be the only available option)?

Thanks. Yes that was the issue. It works now

Thanks for your help!

1 Like