Example #1
0
        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));
        }
Example #2
0
        public TableLanguage Get(string id)
        {
            TableLanguage data = null;

            _ins.mDict.TryGetValue(id, out data);
            return(data);
        }
Example #3
0
        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}";
        }