/// <summary> /// Called via LoLManager when language data is received /// </summary> public void Load(string langCode, string json) { mCurLang = langCode; if (mCurLang == null) //langCode shouldn't be null { mCurLang = ""; } //load up the language Dictionary <string, object> defs; if (!string.IsNullOrEmpty(json)) { defs = JSON.Parse(json) as Dictionary <string, object>; } else { defs = new Dictionary <string, object>(); } mEntries = new Dictionary <string, M8.LocalizeData>(defs.Count); foreach (var item in defs) { string key = item.Key; string val = item.Value.ToString(); M8.LocalizeData dat = new M8.LocalizeData(val, new string[0]); mEntries.Add(key, dat); } Refresh(); }
protected override bool TryGetData(string key, out LocalizeData data) { if (mEntries == null) { GenerateEntries(languageIndex); } return(mEntries.TryGetValue(key, out data)); }
protected override bool TryGetData(string key, out LocalizeData data) { if (mEntries == null && !string.IsNullOrEmpty(mJSON)) { mEntries = GenerateEntries(mJSON); } return(mEntries.TryGetValue(key, out data)); }
protected override bool TryGetData(string key, out LocalizeData data) { if (!mEntries.TryGetValue(key, out data)) { if (mEntries == mEntriesBase || mEntriesBase == null || !mEntriesBase.TryGetValue(key, out data)) { return(false); } } return(true); }
protected override bool TryGetData(string key, out M8.LocalizeData data) { #if UNITY_EDITOR if (mEntries == null) { LoadFromReference(); } #endif if (mEntries == null) { data = new M8.LocalizeData(); return(false); } return(mEntries.TryGetValue(key, out data)); }
protected abstract bool TryGetData(string key, out LocalizeData data);
protected override bool TryGetData(string key, out LocalizeData data) { return(mEntries.TryGetValue(key, out data)); }