Can I keep centred text centred in RTL languages?

More
3 years 2 months ago #1638 by hengineer
Hi,
How can I prevent my centred text from being forcibly right-aligned in RTL languages?
I realize I can uncheck the "Adjust Alignment" checkbox but there are a lot of fields I would need to change so I'm wondering if there is an easier way.
It seems to me like the automatic converter should only make the text right-aligned if it was left-aligned in the original language. When I centre text it's usually for aesthetic reasons like headings or button labels so I want it to always stay centred.
Thanks,
Henry

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

More
3 years 2 months ago #1639 by Frank
Hi,
I got a fix for that, I will submit the new beta later today as soon as I get back.

Thanks for reporting this issue
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
The following user(s) said Thank You: hengineer, Mazyod

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

More
3 years 2 months ago #1640 by Frank
Hi,
Build 2.6.8a1 including that fix is now in the Beta Folder.

Hope that helps,
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
The following user(s) said Thank You: Mazyod

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

More
3 years 2 months ago #1641 by Mazyod
Just wow ... I purchased I2 localization yesterday because it promised great Arabic + RTL support, and it delivers. I just ran into two minor issues, one of them is the issue discussed in this topic. I wanted to submit my solution in the forum, but it seems you already took care of that!

I added the following check in LocalizeNGUI.cs, lines 88, 98:
if (Localize.CurrentLocalizeComponent.CorrectAlignmentForRTL && mOriginalAlignmentNGUI != NGUIText.Alignment.Center)

That solved the issue of keeping RTL text centered.

The other issue was that Arabic rendering is not fixed if I use statically typed localized strings. To fix that, I did the following, line 8 in ScriptLocalization.cs:
public static string Get( string Term ) { return Get( Term, LocalizationManager.IsRight2Left, 0); }

Basically, instead of assuming false, we check if the current language is RTL.

I'm excited about how much I2 Localization is helping me achieve great Arabic/English support in my game, and will hopefully contribute all my findings!

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

More
3 years 2 months ago - 3 years 2 months ago #1644 by Frank
Hi!
Thanks a lot for the suggestions!

if (Localize.CurrentLocalizeComponent.CorrectAlignmentForRTL && mOriginalAlignmentNGUI != NGUIText.Alignment.Center)


In version 2.6.8a1 I followed a similar approach. I also tested for when the text is Justified or set to Automatic. Furthermore, the change was also integrated with the other targets (Unity UI, 2DToolkit, textMesh Pro, etc)

The other issue was that Arabic rendering is not fixed if I use statically typed localized strings.


You are totally RIGHT!!
When baking terms, they will not use the RTL fix. I will add your code change to the plugin!!!

Thanks a lot!
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
Last edit: 3 years 2 months ago by Frank.
The following user(s) said Thank You: Mazyod

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

Time to create page: 0.192 seconds
Template by JoomlaShine