Skip to content

Commit

Permalink
Run localization after authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
donker authored and bdukes committed Oct 31, 2020
1 parent bb391b7 commit 104a928
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions DNN Platform/HttpModules/Localization/LocalizationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class LocalizationModule : IHttpModule
/// <inheritdoc />
public void Init(HttpApplication context)
{
context.BeginRequest += Context_BeginRequest;
context.PreRequestHandlerExecute += Context_PreRequestHandlerExecute;
}

/// <inheritdoc />
Expand All @@ -24,16 +24,25 @@ public void Dispose()
// intentionally left empty
}

private static void Context_BeginRequest(object sender, EventArgs e)
private static void Context_PreRequestHandlerExecute(object sender, EventArgs e)
{
var isPage = HttpContext.Current.CurrentHandler is Framework.PageBase;
if (!isPage)
{
return;
}

var isInstallPage = HttpContext.Current.Request.Url.LocalPath.ToLowerInvariant().Contains("installwizard.aspx");
if (isInstallPage)
{
return;
}

var portalSettings = PortalController.Instance.GetCurrentSettings();
Localization.SetThreadCultures(Localization.GetPageLocale(portalSettings), portalSettings);
if (portalSettings != null)
{
Localization.SetThreadCultures(Localization.GetPageLocale(portalSettings), portalSettings);
}
}
}
}

0 comments on commit 104a928

Please sign in to comment.