Problem with changing language using culture info RRS feed

  • Question

  • User500072683 posted

    I'm using the following msdn article to use different languages in my web application:


    I'm following the instructions step by step in VS 2010, and it creates the resource files exactly how it's supposed to. 

    However, when I run the program it just doesn't apply it. I don't see the different values from the resource file. 

    If I leave my resource file name as sample.aspx.resx, it works. But when I change it to sample.aspx.en-us.resx, it doesn't work. I'm supplying culture from the aspx page's Culter and UICulture properties. I'm being very careful in choosing the correct file name, as that could be the issue,  but it just doesn't work. I also tried changing the culture in the backend code this way:

    Protected Overrides Sub InitializeCulture()

    Dim ci As New System.Globalization.CultureInfo("en")

    System.Threading.Thread.CurrentThread.CurrentCulture = ci

    System.Threading.Thread.CurrentThread.CurrentUICulture = ci


    End Sub

    It still doesn't work.

    Any ideas? 

    Tuesday, August 17, 2010 3:38 PM


  • User500072683 posted

    Actually I figured out the problem. The mistake I made was that I had renamed the default sample.aspx.resx file. You must keep it for it to work, and add the other ".aspx.en-us.resx" file(s).



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 18, 2010 12:54 AM

All replies