SetTerm won't update
Please Log in or Create an account to join the conversation.
Thanks for reporting this issue.
If this is happening to you in version 2.6.0, then its because of a regression introduced by the optimizations made to not localize multiple times when the language changes.
I just uploaded a new beta (2.6.0 b5) that corrects the issue.
You can also fix the issue by replacing the SetTerm function (file Localize.cs, line 269-277) with this one:
public void SetTerm (string primary, string secondary=null)
{
if (!string.IsNullOrEmpty(primary))
FinalTerm = Term = primary;
if (!string.IsNullOrEmpty(secondary))
FinalSecondaryTerm = SecondaryTerm = secondary;
OnLocalize (true); // this was changed to add the <true>
}
Hope that helps
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Please Log in or Create an account to join the conversation.
Frank wrote: Hi,
Thanks for reporting this issue.
If this is happening to you in version 2.6.0, then its because of a regression introduced by the optimizations made to not localize multiple times when the language changes.
I just uploaded a new beta (2.6.0 b5) that corrects the issue.
You can also fix the issue by replacing the SetTerm function (file Localize.cs, line 269-277) with this one:
public void SetTerm (string primary, string secondary=null) { if (!string.IsNullOrEmpty(primary)) FinalTerm = Term = primary; if (!string.IsNullOrEmpty(secondary)) FinalSecondaryTerm = SecondaryTerm = secondary; OnLocalize (true); // this was changed to add the <true> }
Hope that helps
Frank
Please Log in or Create an account to join the conversation.
I was using version 2.6.0 b4, and actually the version displayed in the plugin is 2.3.0 b4
Haha, nice catch!
I was testing that the update notifications could be disabled and forgot to reset the version to the latest!
Thanks!!
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Please Log in or Create an account to join the conversation.
It works most of the time, but doesn't seem to work on my prefabs where I SetTerm before displaying it. I've tried toggling the "Pre-Localize on Awake" option but neither setting helped. Any suggestions? Is there any way to force it to do the translation? Although I guess that's what "OnLocalize (true)" should be doing.
Please Log in or Create an account to join the conversation.
I tried reproducing the issue with instantiating a prefab and calling SetTerm but it is working for me. I tried executing the following code:
var go = GameObject.Instantiate( prefabText ) as GameObject;
go.transform.parent = CanvasGO.transform; // only did this because prefabText was an UGUI text
var loc = go.GetComponent<Localize>();
loc.SetTerm("Otro");
I tried running that code when I clicked a button, then on the Start() method and finally on the Awake() method of a custom script.
No matter where, it was always working for me.
Just notice that if the prefab have Unity New UI texts, and you execute on the Awake, the text changes, but the RectTransform may collapse if its not set anchored correctly.
Can you tell me what steps I can do to reproduce your issue and if you can show me a section of the instantiation code you are using, I can try reproducing it over here.
Thanks,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Please Log in or Create an account to join the conversation.