protected override void OnPrepare()
 {
     base.OnPrepare();
     LocalizationModule.Initialize(this);
     this.repository = this.GetRepository <LocalizationRepository>();
     this.content    = ContentModule.GetContent <LocalizationContent>();
 }
Exemple #2
0
 protected virtual void Start()
 {
     if (LocalizationModule.isInitialized)
     {
         var language = LocalizationModule.GetCurrentLanguage();
         this.UpdateState(language);
     }
 }
Exemple #3
0
        protected override void UpdateState(SystemLanguage language)
        {
            foreach (var entity in this.entities)
            {
                var text = entity.text;
                if (!entity.ignoreTranslation)
                {
                    var translation = LocalizationModule.GetTranslation(entity.translationKey);
                    text.text = translation;
                }

                if (entity.advanced)
                {
                    if (entity.TryGetFontSize(language, out var fontSize))
                    {
                        text.fontSize = fontSize;
                    }
                }
            }
        }