Follow @Lusse3 (117 followers)

Flickr Recent Photos

Ebbas frukost består av kall köttfärs i ett salladsblad. Underlig sötnos :)DessertSen är det fika på #valtech :)God lunch med @mohseno2010-03-08 010Fikar med Sara @ vete katten#biltema bjuder på slushies idag :)Fick tag på nå billig cigarr :)Länge sen man unna sig det här, men Inter - Chelsea är värt detÄr det ok att fota sin rotfyllning? :)Vilken dag!Lost och gotta! :)

Categories

EPiServer CMS 5 Wrong culture language

So during an upgrade to EPiServer 5, I ran into this problem where the culture was wrong and all translations were being translated to English instead of Swedish, this even though the web.config was correctly changed to “sv-SE”.

After som trial and error I got to set the culture in onpreinit in the a class that inherits templatepage like this

EPiServer.Globalization.UserInterfaceLanguage.Instance.SetCulture(“sv-SE”)
EPiServer.Globalization.SystemLanguage.Instance.SetCulture(“sv-SE”)

The problem was that only the dates were being formatted correctly, but the translation was still wrong. CurrentPage.LanguageID was not of much help either as it was set to english. At last I found out that you just need to send the short version of the culture to make it work. i.e

EPiServer.Globalization.UserInterfaceLanguage.Instance.SetCulture(“SV”)
EPiServer.Globalization.SystemLanguage.Instance.SetCulture(“SV”)

This did the trick and now everything is in the right format.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>