RTL / Arabic rendering broken

More
7 years 11 months ago #1950 by Mazyod
Hey,

I just updated from v2.6.8 to v2.6.9b1 and it seems all my arabic strings on NGUI are no longer rendering properly, they show as separate characters.
I have followed the recommended approach to upgrade by doing a clean install..

How can I debug/troubleshoot this issue?

Thanks,

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

More
7 years 11 months ago #1951 by Mazyod
I found out that now I have to call:
LocalizationManager.EnableChangingCultureInfo(true);

I really like how the new update doesn't change the culture automatically, but I think applying RTL fix should be automatic. If you think it shouldn't be automatic, I would request it to be a different method, since I don't want automatic culture setting, but I do want automatic RTL fix.

Thanks,

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

More
7 years 11 months ago - 7 years 11 months ago #1953 by Frank
Replied by Frank on topic RTL / Arabic rendering broken
Hi,
Sorry about that!
That's an bug of version 2.6.9b2 where the isRight2Left variable was not been set when not changing the cultureInfo.

You can get the version 2.6.9b3 from the beta folder which includes a fix for that.

Or you can modify the function SetLanguageAndCode as follows:
Assets\i2\localization\scripts\localizationmanager.cs line110
		public static void SetLanguageAndCode( string LanguageName, string LanguageCode, bool RememberLanguage = true, bool Force = false )
		{
			if (mCurrentLanguage != LanguageName || mLanguageCode != LanguageCode || Force)
			{
				if (RememberLanguage)
					PlayerPrefs.SetString ("I2 Language", LanguageName);
				mCurrentLanguage = LanguageName;
				mLanguageCode = LanguageCode;
				if (mChangeCultureInfo)
					SetCurrentCultureInfo();
				else                                            // -----------add this
				IsRight2Left = IsRTL(mLanguageCode);   // -----------and this
				LocalizeAll(Force);
			}
		}

Hope that helps and I will be sending the new version to the store ASAP.

Thanks,
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: 7 years 11 months ago by Frank.
The following user(s) said Thank You: Mazyod

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

More
7 years 11 months ago #1956 by Mazyod
Thank you as always, Frank. The work around is very helpful.
It's not blocking our development, so we can apply the work around and update from the asset store whenever the update is ready.

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

More
7 years 6 months ago #2249 by Ramin
Replied by Ramin on topic RTL / Arabic rendering broken
Hi,
I am totally new user of I2. How can I use arabic font in NGUI label?
thank you

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

More
7 years 6 months ago #2253 by Frank
Replied by Frank on topic RTL / Arabic rendering broken
Hi,
Using Arabic languages works exactly as with the rest of the languages:

First, you need a Font that supports Arabic. NGUI can use either Dynamic Fonts, or Atlas fonts.
If you use dynamic fonts, check that it includes the Arabic characters (e.g. Arial UNICODE, etc). With the dynamic font, your Arabic text will work directly without issues.

If you use an Atlas font, then you need to create a new font that include the characters you are going to use.
My advice is that you first setup everything with a dynamic font, and after you localize your game, you use the tool in I2 Localization that finds ALL the characters you use in your game, Then you build an atlas with only those characters!

There is also more information about how to setup an NGUI font in the NGUI fonts, there are a few topics there about creating a Chinese atlas. The procedure is the same for Arabic.

After you font setup is correct, you just need to add the Arabic language to I2Languages.prefab. And write the translations for each term (or use auto-translate).
When the plugin detects that you are enabling the Arabic language, it will automatically apply the post-processing to all texts so that they render correctly in the game. That way you don't need to do anything extra.
Just create the language, add the translations, and play the game. The text will render correctly as soon as you change to the Arabic language.

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

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

Time to create page: 0.142 seconds
Template by JoomlaShine