none
Wrong CurrentCulture on first page load efter iisreset RRS feed

  • Question

  • Hello everyone,

    I'm having an installation of SharePoint, with a Swedish language pack installed. There is one site collection, which is in Swedish. (CultureInfo.CurrentCulture is thus normally 1053).

    However, during the first page load after an iisreset (or after a server reboot or etc), the CurrentCulture is en-us (1033). All of the menues (e.g. Site Actions etc) are in english, dates are formatted in the american format, etc.

    On the next page load CurrentCulture is 1053 again, so just refreshing the page turns it into Swedish again.

     

    Does anyone else recognize this issue? Any hints on how to avoid it is appreciated!

    Thanks in advance!

    /J

    Wednesday, August 3, 2011 1:03 PM

All replies

  • Hello,

    It's possible that your CurrentUICulture is set to en-US. So the first time the page loads after IISreset, it uses the current UI culture, which is US english.  As outlined in this article, try setting CurrentUICulture to the same value as CurrentCulture.

    HTH!


    - Kemp Brown [MSFT]
    Wednesday, August 3, 2011 9:02 PM
  • Hello and thank you for your reply!

    The problem with your suggestion is, were (in code) would I set CurrentUICulture? Note that the problem applies to any page, including OOTB layouts pages such as "/_layouts/viewlsts.aspx" which has not been customized in any way. I don't run any custom code there and I can't see were I could inject it to change culture (and do it safely) before ANY of the OOTB elements are loaded.

    Also, I have checked CurrentCulture and CurrentUICulture: On first page load, both are 1033, on second page load, both are 1053.

     

    Best regards,

    /J

    Wednesday, August 3, 2011 9:27 PM