public static void Open() { if (Nation.IsOpened) { Nation.Close(); } Nation_ISO3166.Open(); Nation_ISO3166.IsoCodeOrderList.Add("UN"); UnityLanguage[] unityLanguageList = { new UnityLanguage("at", "at"), new UnityLanguage("au", "au"), new UnityLanguage("be", "be"), new UnityLanguage("cz", "cz"), new UnityLanguage("dk", "dk"), new UnityLanguage("fi", "fi"), new UnityLanguage("gr", "gr"), new UnityLanguage("ie", "it"), new UnityLanguage("mx", "mx"), new UnityLanguage("nl", "nl"), new UnityLanguage("no", "no"), new UnityLanguage("nz", "nz"), new UnityLanguage("pt", "pt"), new UnityLanguage("se", "se"), new UnityLanguage("gb", "uk"), new UnityLanguage("za", "za"), new UnityLanguage("br", "br"), new UnityLanguage("ca", "ca"), new UnityLanguage("ch", "ch"), new UnityLanguage("cn", "cn"), new UnityLanguage("de", "de"), new UnityLanguage("es", "es"), new UnityLanguage("fr", "fr"), new UnityLanguage("hk", "hkg"), new UnityLanguage("hu", "hu"), new UnityLanguage("it", "it"), new UnityLanguage("jp", "jp"), new UnityLanguage("kr", "kr"), new UnityLanguage("us", "us"), }; Nation.UnityLanguages = new Dictionary <string, UnityLanguage>(unityLanguageList.Length); for (int n = 0; n < unityLanguageList.Length; ++n) { if (!Nation.UnityLanguages.ContainsKey(unityLanguageList[n].WebIsoCode)) { Nation.UnityLanguages.Add(unityLanguageList[n].WebIsoCode, unityLanguageList[n]); } } }
public static string GetName(string isoCode) { if (!Nation_ISO3166.IsOpened) { Nation_ISO3166.Open(); } string value; if (Nation_ISO3166.Map.TryGetValue(isoCode.ToUpper(), out value)) { return(value); } return(""); }