Right to Left examples

More
9 years 7 months ago #201 by Livealot
One of the main reasons I bought i2 was the promise of support for right to left language, like Arabic. I don't see anything in the docs so could use some guidance.

In the Localize widget what does "Ignore Right to Left Languages" do and how does the related drop down work ("Don't modify, ToUpper, ToLower). The asset store description talks about automatically adjusting alignment, but would be good to hear how that works.

Also, do you have any font recommendations for Arabic?

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #207 by Frank
Replied by Frank on topic Right to Left examples
Hi, Welcome!

All the Right-To-Left Language conversion happens behind the scenes.

Usually, if you just place an arabic text inside a TextMesh or a label, Unity will not display it correctly.

The I2 Localization, knows which languages need to be fixed (there is a list of those in LocalizationManager.LanguagesRTL)

When the plugin updates a label text, it also parses the text and modifies it into a new one that is displayed correctly by Unity.

In case you want to disable that feature for some labels, there is a toggle in the Localize component that skips that (Ignore Right To Left Languages).

The plugin is also capable of modifying the localized text for some labels. It has predefined options to make it Upper Case or Lower case. So that you don't have to duplicate the localization just to make a Title in Uppercase.

Also, there are callbacks that you can register to modify the text with your custom script. That will allow you to insert numbers an other string by using the localized text as a guide.

Please, Let me know if you need me to further explain any of those features.
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago - 9 years 7 months ago #211 by Livealot
Replied by Livealot on topic Right to Left examples
Great to hear that RTL is all automatic since I wouldn't even know where to begin! Although in my testing it looks like Arabic is still left justified. Is there a setting in NGUI to use/not use that will allow the auto-update to do its magic?

Separately, I think my confusion came from both the RTL toggle and the Upper/Lower option being on the same line in the editor, which made me think they were related. In reality, they are two, separate, cool features.

cool stuff!
Last edit: 9 years 7 months ago by Livealot. Reason: added new info

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #213 by Livealot
Replied by Livealot on topic Right to Left examples
bumping since trying to edit my post did not update the timestamp

Please Log in or Create an account to join the conversation.

More
9 years 7 months ago #217 by Frank
Replied by Frank on topic Right to Left examples
Hi,
The current RTL language support only renders the text in the correct order, but they are still rendered using the alignment set on the label (NGUI, age, etc.) so that the text doesn't move into an unwanted location.

When the plugin detects an RTL language, it automatically changes the text so that they get rendered properly. So it fixes the text as shown in the next image. I just doesn't change the left or right alignment of the label.



However, is a good idea to allow the plugin to also adjust the alignment while still allowing to disable that feature for specific texts that you want to get centered or on specific places. I will include that as a new feature.

Thanks for the idea and keep it coming :-)
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out

Please Log in or Create an account to join the conversation.

More
9 years 6 months ago #221 by Livealot
Replied by Livealot on topic Right to Left examples
Cool. That's the picture that made me think you also do auto-alignment. Glad to hear that you're putting it on the feature roadmap.

When you do, I would vote for the feature to be label-specific, not term-specific. That way we could adjust the alignment if we use the same term in different ways across the scenes.

I would also vote for the default behavior to reverse left-alignment labels to right, but NOT the other way around. That way, if we're already using right-alignment for LTR text, nothing would change for RTL text.

Or, better yet, instead of just providing a default behavior with an on/off toggle, you could also provide a specific alignment override for RTL. That should eliminate the corner cases in usage.

Please Log in or Create an account to join the conversation.

Time to create page: 0.176 seconds
Template by JoomlaShine