Search Unity

Feedback LocalizeStringBehaviour.cs can't change LocalizedString and update RegisterChangeHandler

Discussion in 'Localization Tools' started by unknowndevice, May 14, 2020.

  1. unknowndevice

    unknowndevice

    Joined:
    Sep 13, 2016
    Posts:
    86
    Hi I've notice a problem I have with LocalizeStringBehaviour.

    1) I add the LocalizeStringBehaviour to a text component
    2) I set the LocalizedString StringReference property in the inspector
    3) Later in code I change the referenced LocalizedString using the StringReference property.
    4) Later again I then call StringReference.RefreshString(), the RegisterChangeHandler code in OnEnable of LocalizeStringBehaviour is now invalid and will cause a error.

    There doesn't appear to be a way to fix the StringReference in LocalizeStringBehaviour to RegisterChangeHandler to UpdateString again. Maybe it would be best when the StringReference propery is set in code is resets the RegisterChangeHandler as well. I think this is the excepted behaviour if you're using LocalizeStringBehaviour.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Hi,
    Thanks for the feedback.
    We have already fixed this in the next version (0.7.0).
    Scheduled for release at the start of next month.
    Thanks
     
  3. unknowndevice

    unknowndevice

    Joined:
    Sep 13, 2016
    Posts:
    86
    Great! Thanks Karl!
     
    karl_jones likes this.