U4-7873 - fix GetCulture issue with languages

This commit is contained in:
Shannon
2016-02-10 16:22:06 +01:00
parent cf0b72fd77
commit 89f6089f8e
2 changed files with 48 additions and 8 deletions

View File

@@ -78,16 +78,14 @@ namespace Umbraco.Web.Models
domain = pos == 0
? null
: domainHelper.DomainForNode(int.Parse(route.Substring(0, pos)), current).UmbracoDomain;
}
}
if (domain == null || domain.LanguageIsoCode.IsNullOrWhiteSpace())
return GetDefaultCulture(localizationService);
var rootContentId = domain == null ? -1 : domain.RootContentId;
var wcDomain = DomainHelper.FindWildcardDomainInPath(domainService.GetAll(true), contentPath, rootContentId);
var wcDomain = DomainHelper.FindWildcardDomainInPath(domainService.GetAll(true), contentPath, domain.RootContentId);
return wcDomain == null
? new CultureInfo(domain.LanguageIsoCode)
: new CultureInfo(wcDomain.LanguageIsoCode);
if (wcDomain != null) return new CultureInfo(wcDomain.LanguageIsoCode);
if (domain != null) return new CultureInfo(domain.LanguageIsoCode);
return GetDefaultCulture(localizationService);
}
private static CultureInfo GetDefaultCulture(ILocalizationService localizationService)