diff --git a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs index 65db080e138..434f9e2db9d 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs @@ -10,7 +10,9 @@ namespace DotNetNuke.Web.Mvc using System.Web.SessionState; using DotNetNuke.ComponentModel; + using DotNetNuke.Entities.Portals; using DotNetNuke.HttpModules.Membership; + using DotNetNuke.Services.Localization; using DotNetNuke.UI.Modules; using DotNetNuke.Web.Mvc.Common; using DotNetNuke.Web.Mvc.Framework.Modules; @@ -66,6 +68,7 @@ protected virtual bool IsReusable void IHttpHandler.ProcessRequest(HttpContext httpContext) { + this.SetThreadCulture(); MembershipModule.AuthenticateRequest(this.RequestContext.HttpContext, allowUnknownExtensions: true); this.ProcessRequest(httpContext); } @@ -93,6 +96,23 @@ protected virtual void ProcessRequest(HttpContext httpContext) this.ProcessRequest(httpContextBase); } + private void SetThreadCulture() + { + var portalSettings = PortalController.Instance.GetCurrentSettings(); + if (portalSettings is null) + { + return; + } + + var pageLocale = Localization.GetPageLocale(portalSettings); + if (pageLocale is null) + { + return; + } + + Localization.SetThreadCultures(pageLocale, portalSettings); + } + private IModuleExecutionEngine GetModuleExecutionEngine() { var moduleExecutionEngine = ComponentFactory.GetComponent();