After upgrade, Dictionary items fail when CurrentUICulture set form HttpModule
I have a few international sites running umbraco where I've created a class inheriting from IHttpModule and in the contextBeginRequest() method setting the following:
string Lang = "fr-FR";
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Lang); Thread.CurrentThread.CurrentUICulture = new CultureInfo(Lang);
I can see the breakpoints hit on these lines when debugging, but they no longer control the dictionary. Interestly, I found a way around this issue by adding the following Razor code to my site template:
After upgrade, Dictionary items fail when CurrentUICulture set form HttpModule
I have a few international sites running umbraco where I've created a class inheriting from IHttpModule and in the contextBeginRequest() method setting the following:
string Lang = "fr-FR";
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Lang);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(Lang);
I can see the breakpoints hit on these lines when debugging, but they no longer control the dictionary. Interestly, I found a way around this issue by adding the following Razor code to my site template:
<umbraco:Macro runat="server" language="cshtml">
@Helper.SetLanguage()
</umbraco:Macro>
SetLanguage() executes:
string Lang = "fr-FR";
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang); Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
Thanks,
-Carter
is working on a reply...