public static GPLanguage getDefaultLanguage() { if (defLang == null) { defLang = GPLanguageList.getShared().languages[0]; } return(defLang); }
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); } } }
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); } }
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); }
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); }
public static void setCurrentLanguage(GPLanguage value) { GPStrings.setSharedStrings(value.getStrings()); currLang = value; }