Welcome, Guest
Username: Password: Remember me

TOPIC: OutOfRangeException generating term script

OutOfRangeException generating term script 5 months 1 week ago #2921

  • r.pedra
  • r.pedra's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
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?
The administrator has disabled public write access.

OutOfRangeException generating term script 5 months 1 week ago #2922

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1122
  • Thank you received: 239
  • Karma: 69
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: 5 months 1 week ago by Frank.
The administrator has disabled public write access.

OutOfRangeException generating term script 5 months 1 week ago #2923

  • r.pedra
  • r.pedra's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Hi,
Thank you for your answer. Waiting for it to be in the main branch then
The administrator has disabled public write access.
Time to create page: 0.145 seconds
Colors