views:

101

answers:

2

Hello, I'm developing a twitter client (YES, another one) for the RTL languages.

How can a UILabel alignment be configured depending on the language of a tweet. So if language of the tweet is Arabic for example the alignment would be UITextAlignmetRight and vice versa.

A: 

Simply set the textAlignment property of the UILabel in code:

label.textAlignment = UITextAlignmentRight;
gerry3
This question is not specific to the iPhone and/or UILabel. You are asking: "Given a string, how do I determine what language it uses?". The best you can probably do is look for certain key characters or character frequencies, but you may get better answers if you ask a new question worded as I have to get a larger/different audience.
gerry3
A: 

thanks gerry3, you are missing the point here, my question was how to make UILabel magically figure out what language its about to draw so it sets the alinement accordingly. arabic tweet == (UITextAlinmentTight), english tweet == (UITextAlinmetLeft).

I hope I made it clear this time thanks in advance

photon