Objects not localizing in Unity 2018.1 beta

More
1 year 4 months ago #2827 by Frank
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

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

More
1 year 3 months ago #2858 by Dakk
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,

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

Time to create page: 0.157 seconds
Template by JoomlaShine