EPiServer CMS 5 Wrong culture language
by Rizo on mar.02, 2009, under Developing
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.
12 Trackbacks / Pingbacks for this entry
oktober 4th, 2023 on 01:33
… [Trackback]
[…] Find More Information here to that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
oktober 9th, 2023 on 11:18
… [Trackback]
[…] Find More on to that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
november 16th, 2023 on 02:31
… [Trackback]
[…] Read More here to that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
november 21st, 2023 on 01:38
… [Trackback]
[…] There you will find 94590 more Info on that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
december 6th, 2023 on 13:23
… [Trackback]
[…] Read More here to that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
december 8th, 2023 on 11:46
… [Trackback]
[…] Find More Info here to that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
december 18th, 2023 on 01:45
… [Trackback]
[…] Read More on to that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
december 28th, 2023 on 01:28
… [Trackback]
[…] Read More on on that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
februari 1st, 2024 on 02:02
… [Trackback]
[…] There you will find 52954 more Info on that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
februari 2nd, 2024 on 16:02
… [Trackback]
[…] Find More Information here on that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
februari 8th, 2024 on 09:10
… [Trackback]
[…] There you can find 13619 additional Information to that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]
februari 8th, 2024 on 09:28
… [Trackback]
[…] Here you will find 6817 additional Info on that Topic: from-rizo.se/episerver-cms-5-wrong-culture-language/ […]