I am working on an application, where I have to implement arbic as well as english locale.
I have made seperate storyboards for both languages. Problem is autolayout constraints are automatically flipping my views. Is there anyway to stop auto flipping for arabic locale?
I want to design views myself for arabic.
Thanks
Constraints by default respect language direction, but you can turn this off by selecting the constraint, and then in the Attributes Inspector, unchecking the Respect language direction in the First Item and the Second Item pop down menus.
Note that that option isn't available for all constraints.
Related
I have a large multi language app that does not have auto layout yet. The app contains many default tableview cells. In Arabic the app stays left to right and only uses the arabic localized strings. Is there a way to turn off this new right-to-left support so that default tableviewcells and navigation controller buttons are not flipped?
I know this approach via autolayout... in autolayout you can disable right to left change by selecting particular constraint and in property inspector untick the lable which says respect language...
I see that iOS9 and xCode7 introduced a new field called "semantic" into storyboard config. A google search did not reveal relevant results on top.
What is the significance of the view semantic field?
There is a new internationalization support in iOS 9, which enables flipping of the interface from left to right and vice versa depending on the current system language. You can choose Arabic language to test it. Arabic is read from right to left, so the interface is flipped.
Here you can read the Apple's guide on it.
The property "Semantic" in the storyboard is a rule which allows the iOS to know if the view should be flipped or not. There are multiple options:
Unspecified - The default value for views. The view is flipped when switching between left-to-right and right-to-left layouts.
Playback - A view representing the playback controls, such as Play, Rewind, or Fast Forward buttons or playhead scrubbers. These views are not flipped when switching between left-to-right and right-to-left layouts.
Spatial - A view representing a directional control, for example a segment control for text alignment, or a D-pad control for a game. These views are not flipped when switching between left-to-right and right-to-left layouts.
Force Left-To-Right - A view that is always displayed using a left-to-right layout.
Force Right-To-Left - A view that is always displayed using a right-to-left layout.
Source - Apple's documentation
As far as i know, Auto-layout supports both RTL and LTR for the current held device language. But i need to my UI elements to support LTR according to a language selection button . Is there any possible way to reload the UI using Autolayout?
Make two arrays as properties, holding the constraints for LTR layout and RTL layout.
Depending on the selected state you remove one set from the view and add the other.
It means doing programmatic auto layout but that's not really too bad. The guide provided in the docs is an easy read.
So, i've been looking anywhere an explanation about how to implement Mirroring on Storyboard's Auto Layout - not programmatically.
I have an app that support a few languages and when i turn the language to Hebrew, for example, i have a label that change it's text to hebrew. so far so good. what i want to do next is to change the label's place like a mirror.
Can anyone help me understand how to do it on Storyboard Auto Layout?
Thanks.
After doing some research, i found the answer:
First, you have to implement an Internationalization. you can follow Ray's Wenderlich tutorial for Internationalization by enter this link:
http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014 .
Now, on Storyboard, all you have to do is putting some constraints to your label:
put trailing and leading constraints to the label you want to reflect like a mirror when the user switch the language, and that's it.
It's much more easy then design a new Storyboard and you're using the elements that Apple gave you, so i guess it's the right way too.
Hope it helps.
I have a problem that the position of a button \ image is changed according to the language localization.
e.g. in Hebrew the alignment is right-to-left in opposite to English.
this causes the buttons \ images to be positioned on the other side of the screen, in oppose to English position.
how do I disable ios from re-positioning the buttons (according to localization)?
How many languages are there for localization in your application?
If you think that there are more problems in UI then create separate .xibs file for separate localization.
Please check the link. This will help you.
https://www.clairereynaud.net/blog/getting-your-iphone-app-ready-for-localization/
I've found a simple way for doing this:
go to the controller you want to fix it's position, and select it's constraints.
set Direction property to "Left to Right" instead of Leading to Trailing".