OutOfRangeException generating term script

More
6 years 8 months ago #2921 by r.pedra
Hello,
I try to generate ScriptLocalization.cs but every time I select all the terms and click "Build script with selected terms" it throws this error:
"IndexOutOfRangeException: Index was outside the bounds of the array."

Here is the call stack:
IndexOutOfRangeException: Index was outside the bounds of the array.
at I2.Loc.LocalizationEditor.ScriptTool_AdjustTerm (System.String Term, System.Boolean allowFullLength) [0x00008] in /Users/romainpedra/Git/Airlines-Manager-2-Mobile_Unity_2017.3/Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Tools_Script.cs:192
at I2.Loc.LocalizationEditor.BuildScriptWithSelectedTerms (System.Text.StringBuilder sb) [0x0005e] in /Users/romainpedra/Git/Airlines-Manager-2-Mobile_Unity_2017.3/Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Tools_Script.cs:141
at I2.Loc.LocalizationEditor.BuildScriptWithSelectedTerms () [0x0007f] in /Users/romainpedra/Git/Airlines-Manager-2-Mobile_Unity_2017.3/Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Tools_Script.cs:96
at (wrapper delegate-invoke) <Module>:invoke_void ()
at UnityEditor.EditorApplication.Internal_CallUpdateFunctions () [0x00010] in /Users/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127

(Filename: Assets/I2/Localization/Scripts/Editor/Localization/LocalizationEditor_Tools_Script.cs Line: 192)

Can you help us?

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

More
6 years 8 months ago - 6 years 8 months ago #2922 by Frank
Hi,
Thanks for reporting this. This issue is now fixed in 2.8.6a1 (will be uploading to the beta folder later today).

Also, the tool was modified to not only include the translations of the terms, but also variables containing the term name.
For example, If you have the term "Tutorials/Main Tutorial" translated as "Welcome back!"
var translation = ScriptLocalization.Tutorials.Main_Tutorial;   // returns "Welcome back!"

var termName = ScriptTerms.Tutorials.Main_Tutorial;   // returns "Tutorials/Main Tutorial"

That way you can set terms without using string constants:
label.GetComponent<Localize>().SetTerm( ScriptTerms.Tutorials.Main_Tutorial );

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
Last edit: 6 years 8 months ago by Frank.

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

More
6 years 8 months ago #2923 by r.pedra
Hi,
Thank you for your answer. Waiting for it to be in the main branch then

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

Time to create page: 0.183 seconds
Template by JoomlaShine