Welcome, Guest
Username: Password: Remember me

TOPIC: Objects not localizing in Unity 2018.1 beta

Objects not localizing in Unity 2018.1 beta 3 months 1 week ago #2827

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1081
  • Thank you received: 231
  • Karma: 68
Hi,
It seems that in the 2018.1 beta, the behavior of the [RuntimeInitializeOnLoadMethod] and [InitializeOnLoad] attributes changed and now it can't be inherited.

I will be releasing a new beta later tomorrow (2.8.4a6) with the a complete fix, but in the meantime, a way to fix it locally is to open each of the targets in the folder Assets\I2\Localization\Scripts\Targets
and change the
[I2EditorInitialize]
with:
    #if UNITY_EDITOR
    [UnityEditor.InitializeOnLoad] 
    #endif 

and the
[I2RuntimeInitialize]
with
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]


it should look like this:
namespace I2.Loc
{
    #if UNITY_EDITOR
    [UnityEditor.InitializeOnLoad] 
    #endif
    public class LocalizeTarget_UnityUI_Text : LocalizeTarget<UnityEngine.UI.Text>
 {
        static LocalizeTarget_UnityUI_Text() { AutoRegister(); }
        [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] static void AutoRegister() { LocalizationManager.RegisterTarget(new LocalizeTargetDesc_Type<Text, LocalizeTarget_UnityUI_Text>() { Name = "Text", Priority = 100 }); }

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
The administrator has disabled public write access.

Objects not localizing in Unity 2018.1 beta 2 months 3 weeks ago #2858

  • Dakk
  • Dakk's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Hi,
I am seeing this same issue in the new LTS Unity build- 2017.4.0f1.
I have I2L v 2.8.4f1 but it does not seem to fix the problem.

Some seemingly random text does not translate- some does. Some text shows the Key value instead of a translation.

Any help appreciated.
Thanks,
The administrator has disabled public write access.
Time to create page: 0.399 seconds
Colors