locked
Strange problem with Culture definition RRS feed

  • Question

  • User-1204646426 posted

    Hi everybody...

    I have an ASP.NET page that works perfectly in development environment, but when I publish it, decimal separator and thousand separator don't match the current culture.

    I am using this code at the begining of a page to display the current culture:

    Response.Write(System.Threading.Thread.CurrentThread.CurrentCulture.DisplayName + "<br>");
    Response.Write(System.Threading.Thread.CurrentThread.CurrentUICulture.DisplayName);

      Well, the culture and UIculture displayed in production environment are correctly my culture (Spanish and Chile) but, the strangest thing is that the names appear in English, this way:

    Spanish (Chile)

    If I run the code in development server, the text shown is correct:

    Español (Chile)

     Why if UICulture and Culture for the thread is correct, the name is displayed in English and the decimal and thousand separators are "." and "," respectively? In Chile they should be "," for decimal, and "." for thousands.

    Thanks in advance

    Jaime

    Wednesday, April 4, 2007 10:55 AM

All replies

  • User113421904 posted

    Hi Jaime,

    Have you explictly set the culture in your web.application. Try this, please change it to your local setting.

    <globalization enableClientBasedCulture="true" culture="en-US" uiCulture="en-US"/>

    Friday, April 6, 2007 1:48 AM
  • User-1204646426 posted

    Hello and thanks for answer.. but that doesn't solve the problem. I have this in web.config:

    <globalization enableClientBasedCulture="true" uiCulture="es-CL" culture="es-CL"/>

    I have es-CL in global application settings too (by using IIS administration). I have set that at Page level too, but nothing.

    Other fact is that in that page I have a ReportViewer control which does work (the local report has Spanish (Chile) as the language setting).

    Jaime

    Monday, April 9, 2007 8:39 AM
  • User113421904 posted

    Hi,

    This is depending on the .NET Framework version. For example, if the .NET Framework English version is installed, the DisplayName for the specific culture U.S. English is "English (United States)". If the .NET Framework Spanish version is installed, regardless of the language that the system is set to display, the culture name is displayed in Spanish; therefore, the DisplayName for the specific culture U.S. English is "Ingles (Estados Unidos)".

     

    Friday, April 13, 2007 1:25 AM