public LanguageData(string code, ILanguageTranslator translator) { Code = code; Translator = translator; Name = translator.Translate(TranslatableKeys.LanguageName).Text; }
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); }
private void UpdateText(ILanguageTranslator translator) { TextComponent.text = translator.Translate(key).Text; TextComponent.font = translator.Translate(key).FontAsset; }
private void UpdateText(ILanguageTranslator translator) { var data = translator.Translate(key); TextComponent.text = data.Text; }