/// <summary> /// Finds the name of the country. /// </summary> /// <param name="countryCode">The country code.</param> /// <param name="variant"></param> /// <returns></returns> public string FindCountryName(string countryCode, AltVariant variant = AltVariant.Common) { var countryNames = FindCountryNames(countryCode); if (countryNames.ContainsKey(variant)) { return(countryNames[variant]); } else { return(null); } }
/// <summary> /// Finds the name of the country. /// </summary> /// <param name="languageCode">The country code.</param> /// <param name="variant"></param> /// <returns></returns> public string FindLanguageName(string languageCode, AltVariant variant = AltVariant.Common) { var languageNames = FindLanguageNames(languageCode); if (languageNames.ContainsKey(variant)) { return(languageNames[variant]); } else { return(null); } }
/// <summary> /// Gets the locale postfix. /// </summary> /// <param name="variant">The variant.</param> /// <returns></returns> public static string GetLocalePostfix(this AltVariant variant) { switch (variant) { case AltVariant.Alternative: return("-alt-variant"); case AltVariant.Short: return("-alt-short"); case AltVariant.Long: return("-alt-long"); case AltVariant.Menu: return("-alt-menu"); default: case AltVariant.Common: return(string.Empty); } }