Im creating a bilingual app in iOS. My app support English and Arabic languages. The app works fine in both languages according to Device language.
LeftToRight direction for English and RightToLeft direction for Arabic.
Now I've created a setting in my app for users to switch the language irrespective of the device language i.e. user can switch app language from english to arabic and arabic to english without changing the device language.
All viewControllers are working fine with LTR and RTL directions but the only issue is with NavigationBar Controller.
when app is in english (correct navigationbar behaviour)
When app is in Arabic (incorrect layout direction)
When device and app are in arabic(correct behaviour)
any help is appreciated.
Related
My understanding is that the device language should be set via: Settings > General > Language & Region. My device shows "English" as the language, however when I open my app, certain text such as the Apple sign-in method, and the "back" button for navigation links is in Arabic. I checked this by printing out the NSLocale.current.languageCode value, and ensured it was "ar", which did not match my expectation of "en".
I tried toggling the language from english to french, and back again to english, but the words never changed from arabic to anything else. I've also tried rebooting the simulator, erasing all content and settings, and using different target devices (iphone 13 and 11).
After adding the "Localizations" node in the info.plist file, and setting the first item to "English", the formatting now looks as expected. Thanks for the comment #HangarRash. Still not exactly sure why this is needed since I expected it should be pulled from the simulator's language setting
I have a small issue, the issue is the Keyboards that I am adding from settings -> General-> Keyboards -> Japanese are not getting visible in my iOS App. For example, I added Japanese Keyboard Kana and listed it on the top list, it is still not getting displayed in my App. However it is getting displayed in other Apps like Apple Notes and all.
Did anyone face the same issue. I really need solution for this.
Thanks here is the screenshots of my keyboards added in keyboard section
Press the globe icon to switch between keyboard layouts. Its position will differ slightly depending on the layout.
I'm trying to have the launchScreen.storyboard to change according to the language of the device.
I made storyboards with each one having a different background color for UIImageView at the top see sample...
these storyboards are localized versions of the storyboard, so each one would be chosen according to the language of the device
the problem is :-
it always shows the english version for example when I switch the language of the iPhone's Simulator to Arabic, how can I make each one show up for the language it's localized for?
Unfortunatelly, you won't be able to achieve this. Launch screens are static and it's content is not a subject to localization.
Refering to the Apple human interface guidelines
Avoid including text on your launch screen. Because launch screens are static, any displayed text won’t be localized.
This piece of storyboard was intended to save you from creating a separate launch image for each screen resolution. iOS doesn't translate launch screen storyboards as it didn't give you a way to provide launch image for each of the supported languages.
However, you can find some workaround in this post.
Just to be sure, have you set support for those languages in Project settings(under Localizations) ?
I want to test my iOS app in right-to-left layout on device. When I set "Edit Scheme > Application Language > Right-To-Left Pseudo Language" in Xcode and run on device, the layout is flipped to RTL. However, if I leave "System language" in Xcode and then change the system language to Hebrew in iPhone settings (General > Language and region > iPhone language > Hebrew) my app is not displayed in RTL mode (all other apps do).
Why isn't my app layout changed to RTL when I change the iPhone's language to Hebrew?
I'm using Xcode 8.3.
I found what the problem was. I needed to add the Hebrew language internationalization in Project > Info section. After I re-ran on device, all layout appeared flipped (that is, in the right-to-left layout).
If it is text alignment please try the following
First try getting layout direction by
if ([UIView userInterfaceLayoutDirectionForSemanticContentAttribute:view.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft) {
}
Then set the text alignment as follows.
enter code here
[[(NSMutableParagraphStyle *)paraStyle setAlignment:NSNaturalTextAlignment];
My iOS app is in English, Arabic, and Russian, my app support iPhone and iPad, when change language to Arabic, it works so good on iPhone but on iPad it not work like images that attached down,how to force UITableView custom cell to localise?.
Arabic iPhone version
Arabic iPad version
I try everything finally I deleted tableview and set it again and set everything like normal its worked so good Check image