Localization problem after publish

Last post 05-21-2008 3:50 PM by Keven Boily. 6 replies.

Sort Posts:

  • Localization problem after publish

    05-13-2008, 4:51 PM
    • Loading...
    • Keven Boily
    • Joined on 05-13-2008, 4:44 PM
    • Posts 9

     Hi,

     I must set the language (read : culture and UICulture) of my asp.net projet to french, more specificly "fr-CA". I do not use a ressource file. This is only to force asp controls such as gridviews and login controls to be in french. I put the following code in my Global.asax page :


        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo info = System.Globalization.CultureInfo.CreateSpecificCulture("fr-CA");
            System.Threading.Thread.CurrentThread.CurrentCulture = info;
            System.Threading.Thread.CurrentThread.CurrentUICulture = info;
        }
     

    However, it does not work on the server after publishing it. My development PC is already in french so the site is french when I try it locally but DOES change to english if I put "en-CA" instead. I have tried to add the localization tag in the web.config and I also tried to override the Page.InitializeCulture(). Exact same thing : works locally but not on server.
     

  • Re: Localization problem after publish

    05-13-2008, 7:57 PM
    • Loading...
    • vivek_iit
    • Joined on 06-18-2006, 6:13 PM
    • New Delhi
    • Posts 3,072
    • TrustedFriends-MVPs

    What happens when you publish it? Does the server show only english even if you fr-CA?

    MVP, ASP.NET || My Website || Blog || Articles

    Please mark the most helpful reply/replies as "Answer".
  • Re: Localization problem after publish

    05-14-2008, 8:19 AM
    • Loading...
    • Keven Boily
    • Joined on 05-13-2008, 4:44 PM
    • Posts 9

    All culture dependant controls (gridviews, loginview, etc.) are shown in English. I tried showing the current culture/UICulture on screen and it DOES change to fr-CA. However everything culture dependant stays in english.

     

    Also note that this is published to a web server that already runs many websites.

    I'm using version framework 2.0 btw. 


    I just thought of something. My Visual Studio is in english. Is it possible that on publishing it does not publish the necessary files to set the controls in french? If so, how could I explicitly include it? (I'm thinking of something like a system ressource file maybe?)

  • Re: Localization problem after publish

    05-14-2008, 8:44 PM
    • Loading...
    • vivek_iit
    • Joined on 06-18-2006, 6:13 PM
    • New Delhi
    • Posts 3,072
    • TrustedFriends-MVPs

    Just do one thing for me: try putting a calendar control and see if that work in the server.

    Let me know the results.

    -Vivek
     

    MVP, ASP.NET || My Website || Blog || Articles

    Please mark the most helpful reply/replies as "Answer".
  • Re: Localization problem after publish

    05-15-2008, 8:10 AM
    • Loading...
    • Keven Boily
    • Joined on 05-13-2008, 4:44 PM
    • Posts 9

    I tired putting a calendar control and guess what? It works... (the calendar control at least!)

    As a result I am more confused about this than ever. Why does my gridviews and login control don't translate?

  • Re: Localization problem after publish

    05-20-2008, 8:23 AM
    • Loading...
    • Keven Boily
    • Joined on 05-13-2008, 4:44 PM
    • Posts 9

    I don't know if I've been clear enough : The calendar control works but my problem with the other controls is still there.

     

    Does any one have any idea?? 

  • Re: Localization problem after publish

    05-21-2008, 3:50 PM
    • Loading...
    • Keven Boily
    • Joined on 05-13-2008, 4:44 PM
    • Posts 9

     Small update on my problem : only French is taken into consideration on my local machine (still same problem on server). I tried de-DE, it-IT and es-ES (all verified valid cultures) and my controls show in english as it must be the default value.

    I don't know how to resolve this. Is there something I must include in my project if I want to add languages ?

     

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter