Fixes issue with Base and dictionary items

Work Items: 30382
This commit is contained in:
starfighter83
2011-08-03 08:07:25 -02:00
parent 5363a328a0
commit ba96212505

View File

@@ -92,6 +92,8 @@ namespace umbraco.presentation.umbracobase
if (myExtension.isAllowed)
{
TrySetCulture();
string response = invokeMethod(myExtension, urlArray);
// since return value is arbitrary (set by implementor), check length before checking for error
if (response.Length >= 7)
@@ -225,6 +227,23 @@ namespace umbraco.presentation.umbracobase
}
private static void TrySetCulture()
{
string domain = HttpContext.Current.Request.Url.Host; //Host only
if (TrySetCulture(domain)) return;
domain = HttpContext.Current.Request.Url.Authority; //Host with port
if (TrySetCulture(domain)) return;
}
private static bool TrySetCulture(string domain)
{
var uDomain = cms.businesslogic.web.Domain.GetDomain(domain);
if (uDomain == null) return false;
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(uDomain.Language.CultureAlias);
return true;
}
}