public static string Get(string key, params object[] args) { var t = TableLanguage.Get(key); if (t == null) { #if UNITY_EDITOR || !PUBLISH_BUILD return($"[{key}]"); #else return(key); #endif } var tag = Option.language; string val; if (tag == TAG_EN) { val = t.en; } else if (tag == TAG_CN) { val = t.cn; } else { val = t.en; } if (args == null || args.Length <= 0) { return(val); } return(string.Format(val, args)); }
public TableLanguage Get(string id) { TableLanguage data = null; _ins.mDict.TryGetValue(id, out data); return(data); }
private void Refresh() { musicRadio.Radio(Option.music); vibraitonRadio.Radio(Option.vibration); languageDropdown.options.Clear(); var t = TableLanguage.Get("LANGUAGE_NAME"); string val; foreach (var _tag in LT.Tags) { if (_tag == LT.TAG_EN) { val = t.en; } else if (_tag == LT.TAG_CN) { val = t.cn; } else { val = t.en; } languageDropdown.options.Add(new Dropdown.OptionData(val)); } languageDropdown.value = LT.Tags.IndexOf(Option.language); SetMusic(); version.text = $"{LTKey.VERSION.LT()}: {Application.version}"; }