in-app-payments-ios icon indicating copy to clipboard operation
in-app-payments-ios copied to clipboard

Localization

Open dibelogrivaya opened this issue 1 year ago • 3 comments

Hi! Is there any way of overriding the SDK language? Thanks.

dibelogrivaya avatar Feb 01 '24 11:02 dibelogrivaya

Hi @dibelogrivaya what do you mean by overriding the SDK language? In-App Payments supports multiple languages and as long as the device is set to a language that the SDK supports it will automatically use that language.

brandonjenniges avatar Mar 22 '24 16:03 brandonjenniges

Hi again! I mean setting the language on the fly. It would be nice to have an option to show screens in the specified language (if it is supported by SDK). This is necessary, for example, if you make it possible to authorize different users on one device with the ability to set the interface language for each (after authorization there is no need to switch the interface language in the application settings, everything is immediately displayed in the language specified for this user).

dibelogrivaya avatar Mar 25 '24 19:03 dibelogrivaya

Unfortunately there isn't anything for this supported in the SDK. You could do something like setting a value of the language you want in UserDefaults using the key AppleLanguages but this will still require an app restart for the language to update. But you won't have to go and change the device language in settings.

UserDefaults.standard.set(["fr"], forKey: "AppleLanguages")
/// restart app
/// Next app launch the SDK should now be in "fr"

brandonjenniges avatar Mar 26 '24 22:03 brandonjenniges