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];
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
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.
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 have built a storyboard as a RTL layout in consideration for use in a single language(hebrew),
Now i need to add an english option but the autolayout is mirroring in opposite as natively the storyboard is LTR,
In sum, i have an RTL on a LTR storyboard and i can't find a way to change the storyboard setting from the default LTR to RTL so that the auto mirroring will match the languages,
The language in my info.plist is set to "he",
I have edited the project files so the development language is hebrew,
Is there any way to fix the situation without re-building all the story board?
Thanks,
Apple watch supports Dynamic Type (e.g. by using text styles such as body or footnote). Assuming I have labels that use these custom text styles, how can I test their behavior on the simulator?
On an iPhone simulator, I can launch Settings > General > Larger Text and adjust the slider to see how my app looks depending on different font sizes.
How can I do the equivalent for my Apple Watch app running on the simulator?
No possibility yet. Just set it to bold and some points larger in your storyboard to test it.
Sorry mate...
Edit: I just ran over this:
https://developer.apple.com/watchkit/
Download the Apple Watch Design Resources there and have a look at Guides > Guide-Type. There you will have the right font sizes and weights for Dynamic Type.
You could change text size on apple watch simulator - Settings > Display & Brightness > Text Size.