Example #1
0
        public static LanguageItem GetByName(string sName)
        {
            LanguageItem li = null;

            _list.TryGetValue(sName.ToLower(), out li);
            return(li);
        }
Example #2
0
        //      private static void GetAllLanguageControl(ref System.Windows.Forms.Control control, string sLanguage, bool bReloadLanguageFile = false, bool bSaveOriginalText = false)
        //{
        //	if ((bReloadLanguageFile)) {
        //		string sFileName = string.Format("{0}\\Language\\{1}.txt", Application.StartupPath, sLanguage);
        //		LoadLanguage(sFileName);
        //	}
        //	GetAllLanguageControl(control, bAddToList: bSaveOriginalText);
        //}


        public static string Translate(string sName)
        {
            LanguageItem li = LanguageItem.GetByName(sName);

            if ((li != null))
            {
                return(li.Caption);
            }

            return(string.Format("@{0}", sName));
        }
Example #3
0
        public static int Add(LanguageItem liNew)
        {
            string sKey = liNew.Name.Trim().ToLower();

            var liOld = GetByName(sKey);

            if ((liOld != null))
            {
                liOld.Caption = liNew.Caption;
                return(1);
                //-- update existing item
            }

            _list.Add(sKey, liNew);
            return(0);
            //-- Add new item
        }