コード例 #1
0
        public LanguageData(string code, ILanguageTranslator translator)
        {
            Code       = code;
            Translator = translator;

            Name = translator.Translate(TranslatableKeys.LanguageName).Text;
        }
コード例 #2
0
        public static string Translate(string keyString, ILanguageTranslator translator)
        {
            TranslatableKeys key;

#if UNITY_EDITOR
            key = (TranslatableKeys)System.Enum.Parse(typeof(TranslatableKeys), keyString);
#else
            if (!System.Enum.TryParse(keyString, out key))
            {
                return(string.Empty);
            }
#endif
            return(translator.Translate(key).Text);
        }
コード例 #3
0
 private void UpdateText(ILanguageTranslator translator)
 {
     TextComponent.text = translator.Translate(key).Text;
     TextComponent.font = translator.Translate(key).FontAsset;
 }
コード例 #4
0
        private void UpdateText(ILanguageTranslator translator)
        {
            var data = translator.Translate(key);

            TextComponent.text = data.Text;
        }