/// <summary> /// Gets whether the web has specified locale /// </summary> /// <param name="locale"></param> /// <returns></returns> public bool HasLocale(string locale) { if (string.IsNullOrEmpty(locale)) { return(false); } return(InstalledLocales.Contains(locale.ToLower())); }
/// <summary> /// Gets the locale associated with the specified culture code. /// </summary> /// <returns>True if a matching locale exists; False otherwise.</returns> public bool TryGetLocaleByName(string cultureCode, out InstalledLocales.Locale result) { foreach (var locale in AvailableLocales) { if (string.Equals(locale.Culture, cultureCode, StringComparison.InvariantCultureIgnoreCase)) { result = locale; return true; } } result = null; return false; }