Exemplo n.º 1
0
 public static GPLanguage getDefaultLanguage()
 {
     if (defLang == null)
     {
         defLang = GPLanguageList.getShared().languages[0];
     }
     return(defLang);
 }
Exemplo n.º 2
0
 public void refreshLanguageList()
 {
     languages = new List <GPLanguage>();
     string[] files = GPFileHelper.EnumerateLanguageFiles();
     foreach (string s in files)
     {
         GPLanguage nlang = new GPLanguage();
         if (nlang.LoadHeader(s))
         {
             languages.Add(nlang);
         }
     }
 }
Exemplo n.º 3
0
        public void setCurrentLanguageId(int id)
        {
            GPUserDefaults.SetIntForKey("gcal.current.language", id);
            currentLanguageId = id;
            GPLanguage lan = findLanguageWithId(id);

            if (lan != null)
            {
                lan.loadFile(lan.LanguageFile);
                GPStrings languageStrings = lan.getStrings();
                GPStrings originalStrings = GPStrings.getOriginalStrings();
                GPStrings shared          = GPStrings.getSharedStrings();
                shared.Clear();
                shared.AddRange(originalStrings);
                shared.AddRange(languageStrings);
            }
        }
Exemplo n.º 4
0
        public bool IsNewVersion(GPLanguage lang)
        {
            if (lang.LanguageId <= 0 || lang.LanguageVersion <= 0)
            {
                return(false);
            }

            foreach (GPLanguage lan in languages)
            {
                if (lan.LanguageId == lang.LanguageId)
                {
                    return(lang.LanguageVersion > lan.LanguageVersion);
                }
            }

            return(true);
        }
Exemplo n.º 5
0
        public static GPLanguage getCurrentLanguage()
        {
            if (currLang == null)
            {
                int currLangId = GPUserDefaults.IntForKey("gcal.current.language", -1);
                List <GPLanguage> languages = GPLanguageList.getShared().languages;
                foreach (GPLanguage lang in languages)
                {
                    if (lang.LanguageId == currLangId)
                    {
                        currLang = lang;
                    }
                }

                if (currLang == null)
                {
                    return(new GPLanguage("<default>", ""));
                }
            }
            return(currLang);
        }
Exemplo n.º 6
0
 public static void setCurrentLanguage(GPLanguage value)
 {
     GPStrings.setSharedStrings(value.getStrings());
     currLang = value;
 }