Using numbers in brackets [0] breaks RTL (Arabic)

More
7 years 9 months ago - 7 years 9 months ago #2106 by Multiplayer
Edit:
Apparently the problem only comes up when I use numbers inside of brackets. "0" is ok, "[]" is also ok, but [0] triggers the error. I can comment out the offending lines 308 and 309, but that produces "¬" signs instead of the color changes that I need the brackets for. Also, it does not correctly reverse the Arabic strings.

Edit 2:
Because I can imagine someone would ask that: Checking "Ignore numbers" does not help.


Hi

I am trying to translate into Arabic. Some of my strings include brackets with rgb codes that change the color of the following text. When I try to request these in Arabic, everything breaks down with the following error:
ArgumentOutOfRangeException: Cannot be negative.
Parameter name: startIndex

System.String.Remove (Int32 startIndex, Int32 count) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:1743)
I2.Loc.LocalizationManager.ApplyRTLfix (System.String line, Int32 maxCharacters, Boolean ignoreNumbers) (at Assets/I2/Localization/Scripts/LocalizationManager.cs:309)
I2.Loc.LocalizationManager.TryGetTermTranslation (System.String Term, System.String& Translation, Boolean FixForRTL, Int32 maxLineLengthForRTL, Boolean ignoreRTLnumbers, Boolean applyParameters, UnityEngine.GameObject localParametersRoot) (at Assets/I2/Localization/Scripts/LocalizationManager.cs:250)
I2.Loc.LocalizationManager.GetTermTranslation (System.String Term, Boolean FixForRTL, Int32 maxLineLengthForRTL, Boolean ignoreRTLnumbers, Boolean applyParameters, UnityEngine.GameObject localParametersRoot) (at Assets/I2/Localization/Scripts/LocalizationManager.cs:227)
I2.Loc.LocalizationManager.GetTermTranslation (System.String Term) (at Assets/I2/Localization/Scripts/LocalizationManager.cs:220)
...

the origin is me calling
LocalizationManager.GetTermTranslation(term)
The offending string example is
Loading[FFB8F7].[39F7FF].[FFF56C].


Is this a bug, or am I doing it wrong?
Last edit: 7 years 9 months ago by Multiplayer.

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

More
7 years 9 months ago #2108 by Frank
Hi,
Thanks a lot for reporting this issue.
I was able to reproduce and made a fix for that. It is now working on all the tests I did, but will be great if you could try yours and let me know if there is any other case misbehaving.

I uploaded the new version to the beta folder (v2.6.11 a2)

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.

More
7 years 9 months ago #2110 by Multiplayer
Thank you, I sent you an email for the beta access.

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

More
7 years 9 months ago #2111 by Frank
I sent you an invite!

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.129 seconds
Template by JoomlaShine