public Language FindBestLanguage(string languageName) { if (string.IsNullOrEmpty(languageName)) { languageName = "en"; } try { var cultureInfo = new CultureInfo(languageName); return(LanguageLoader.FindBestLanguage(cultureInfo)); } catch (CultureNotFoundException) { } var language = LanguageLoader.GetAvailableLanguages().FirstOrDefault(x => x.Iso2 == languageName); if (language != null) { return(language); } return(LanguageLoader.FindBestLanguage(new CultureInfo("en"))); }
public Language FindBestLanguage(CultureInfo culture) { return(LanguageLoader.FindBestLanguage(culture)); }