public static void ReleaseInstance() { lock (s_objectLock) { if (s_LangHelper != null) { s_LangHelper = null; } } }
public static LanguageTypeHelper GetInstance() { if (s_LangHelper != null) { return(s_LangHelper); } lock (s_objectLock) { if (s_LangHelper == null) { s_LangHelper = new LanguageTypeHelper(); } } return(s_LangHelper); }
/// <summary> /// Get string value /// </summary> /// <param name="ID">ID of string</param> /// <param name="defaultValue">default English value</param> /// <returns></returns> public string getStringValue(string ID, string defaultValue) { if (!m_StringItemDic.ContainsKey(ID)) { return(defaultValue); } StringItem item = m_StringItemDic[ID]; switch (LanguageTypeHelper.GetInstance().GetCurrentLanguageType()) { case LanguageType.English: return(item.TextEnglish); case LanguageType.Chinese: return(item.TextChinese); default: return(item.TextEnglish); } }