-
Notifications
You must be signed in to change notification settings - Fork 370
Broken UI when device's language is Arabic ( ios 9) #389
Comments
Can you please provide the specific locale (country/region combination) and device you used? Some quick tests on an iPhone 5S and iPhone 6 Plus did not reproduce this error so wondering if there's a more specific combination of settings which results in this behavior. |
@bluk Please check it.Thanks |
@cuongv Thanks for the info. I was able to reproduce the issue with the added Arabic localization and changing the device settings. Working towards a fix. |
Just an update but testing various fixes for the right to left language layouts. Hope to have a release out by the end of the week. |
Pushed out 2.14.0. If there are any additional issues, please let us know. Thanks. |
Good job ! |
👍 |
Hi @bluk , I am facing similar issue when i change the language directly from inside the app from English to Arabic and vice versa. The phone language is not changed and i keep it as English. This scenario happens when i update the app language on the fly, when i restart my app, PayPalPaymentViewController displays expected view i.e RTL or LTR. Also similar thing happens when i force PayPal demo app to update views,tableview using UISemanticContentAttributeForceRightToLeft before calling the PayPalPaymentViewController. Please guide. |
@adityaawok The SDK reads the language settings from the phone's language preferences, so unless you change the phone language and re-initialize the SDK, you may not get any changes in the UI. If I'm misunderstanding what the issue is, please open a new issue with more details and the SDK version, iOS version and the exact locale/language settings are you are trying to use. Thanks. |
According to Apple's guidelines. language shouldn't be changed from inside the app. Apple also doesn't provide an easy way to do it from inside the app in a way to be reflected on the UI direction. For a full background about this please refer to my stack overflow answer here The iOS app and also the paypal SDK depends on the following value on the plist file to layout the screens:
This value can be accessed as following: By changing the AppleLanguages value, app start behaving according to it after an app restart.
Without a restart the UI direction will not get fixed. Surprisingly, PayPal UI doesn't do the same. even after a restart, layout still messed up!! In iOS 9 apple provided the following feature to force changing layout direction: I use this to change the app direction without an app restart after I change the language. Also, may be to investigate why PayPal UI does not behave according to AppleLanguages value when it get changed even after a restart. |
I had the folowing when I wrote the previous comment:
The layout wasnt fixed even after an app restart. but if default language is en. it does get fixed after a restart!!
|
I fixed the issue with a workaround as following:
on
I use this in the plist: And on app launch I change the default to ar if its the first app launch: PayPal is changing the layout direction based on languageOrLocale. but, when the app launguage and the app direction is forced against what is the app original language "CFBundleDevelopmentRegion". PayPal UI start to mess up. Therefore, I return everything to its origins before presenting PayPal controller. |
This SDK has been deprecated. Please check here for more detail. |
https://webappcodes.com/change-right-to-left-view-when-change-language-in-ios This link code are working fine. it's just a one line code for set your app in mirror view. |
When i change the iphone's language to Arabic, the UI for paypal was mess up!
The text was updated successfully, but these errors were encountered: