- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
public static LanguageConfiguration GetLanguageByUrl()
{
string requestHost = HttpContext.Current.Request.Url.Host.ToLower();
foreach (LanguageConfiguration language in languages.Values)
foreach (DomainConfiguration domain in language.Domains)
if (domain.Name.Equals(requestHost))
return language;
return languages[LanguageCodes[0]];
}
public static List<string> LanguageCodes
{
get
{
//caching languages
if (languages == null)
{
languages = new Dictionary<string, LanguageConfiguration>();
if (languagesConfiguration.Languages.Count > 0)
foreach (LanguageConfiguration language in languagesConfiguration.Languages)
languages.Add(language.Code, language);
else
languages.Add(String.Empty, new LanguageConfiguration());
}
return new List<string>(languages.Keys);
}
}
Комментарии (0) RSS
Добавить комментарий