Home All Groups Group Topic Archive Search About

.NET Framework Ignores Regional Settings on WinXP

Author
30 Sep 2005 7:45 AM
mirzas

Hi,

The changes I make on my regional settings are not applied to .NET

Culture is allways en-US and never changes no matter what the system
settings are.

I installed my OS and Dev. tools with default US settings since I never
needed any other regional settings.

Now I need to change them but can't.

Any ideas?


Env: WinXP SP2 / .NET 1.1 SP1


Best Regards

Author
30 Sep 2005 8:11 AM
CT
Where do you need the other cultures? Do you need to change it based on the
regional settings, or do you want to do it from code?

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

Show quoteHide quote
"mirzas" <mirza.se***@gmail.com> wrote in message
news:1128066304.182900.228960@g49g2000cwa.googlegroups.com...
> Hi,
>
> The changes I make on my regional settings are not applied to .NET
>
> Culture is allways en-US and never changes no matter what the system
> settings are.
>
> I installed my OS and Dev. tools with default US settings since I never
> needed any other regional settings.
>
> Now I need to change them but can't.
>
> Any ideas?
>
>
> Env: WinXP SP2 / .NET 1.1 SP1
>
>
> Best Regards
>
Are all your drivers up to date? click for free checkup

Author
30 Sep 2005 11:18 AM
mirzas
I need .NET framework to use the system settings.

...Currency symbol, decimal separator and other culture specific stuff.
Author
30 Sep 2005 2:30 PM
Michael Nemtsev
Hello mirzas,

m> I need .NET framework to use the system settings.
m> ..Currency symbol, decimal separator and other culture specific
m> stuff.

U can change it programmatically
See System.Globalization namespace and class CultureInfo.
Moreover, read it http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vxoriGlobalizationLocalizationNamespaces.asp

By the way u can download localized FW, it's avaible for the about 10 languages
on the MS download site

---
WBR,
Michael  Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Author
30 Sep 2005 3:26 PM
mirzas
No, I need .NET to respond when I change regional settings inside
control panel. After all, those are system wide settings.

Why is it not aware of the system setting?
Does Thread.CurrentThread.CurrentCulture  return the system/user
regional setting ?

I must read whatever is set up in regional settings and use that. No
configuration files.

btw. GetSystemDefaultLCID returns 4122 which is the correct setting.
Author
3 Oct 2005 5:55 AM
CT
Mirzas,

When formatting numbers, dates etc, your application will use the regional
settings on teh current system. However, you need to use the proper
formatting options wherever you need it. Say you want to format a number and
have the currency symbol applied, simply use the "C" formatting string, like
this:

int numberToFormat = 345353;
string formattedNumber = numberToFormat.ToString("C");

As I see it, it's a matter of using the correct formatting strinsg, which
are locale aware.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, AND MSF
http://www.apress.com/book/bookDisplay.html?bID=105
Communities - http://community.integratedsolutions.dk

Show quoteHide quote
"mirzas" <mirza.se***@gmail.com> wrote in message
news:1128093968.810830.125000@g49g2000cwa.googlegroups.com...
> No, I need .NET to respond when I change regional settings inside
> control panel. After all, those are system wide settings.
>
> Why is it not aware of the system setting?
> Does Thread.CurrentThread.CurrentCulture  return the system/user
> regional setting ?
>
> I must read whatever is set up in regional settings and use that. No
> configuration files.
>
> btw. GetSystemDefaultLCID returns 4122 which is the correct setting.
>
Author
3 Oct 2005 7:43 AM
mirzas
Thanks for the reply but...

Could you explain this to me then.

while(true)
{
    Console.WriteLine("Change your regional settings and press
enter...");

    Console.ReadLine();
    Console.WriteLine("Settings: " +
Thread.CurrentThread.CurrentCulture.Name);


    Console.WriteLine("DecimalSeparator: " +
Thread.CurrentThread.CurrentUICulture.NumberFormat.NumberDecimalSeparator);
    Console.WriteLine("Currency: " +
Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol);
}


This code should print out the system setting ? but no... no matter
what I set up it always shows en-US
Author
3 Oct 2005 8:26 AM
mirzas
Thanks all, found an answer here
http://www.dotnet247.com/247reference/msgs/57/286777.aspx

quote:
The user and system locale settings have no impact
on the CultureInfo.CurrentUICulture property.
Author
30 Sep 2005 4:37 PM
Marc Bernard
Show quote Hide quote
"mirzas" <mirza.se***@gmail.com> wrote in message
news:1128066304.182900.228960@g49g2000cwa.googlegroups.com...
> Hi,
>
> The changes I make on my regional settings are not applied to .NET
>
> Culture is allways en-US and never changes no matter what the system
> settings are.
>
> I installed my OS and Dev. tools with default US settings since I never
> needed any other regional settings.
>
> Now I need to change them but can't.
>
> Any ideas?


Here's a good place to start:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxoriPlanningGlobalReadyApplications.asp

Marc
http://nomagichere.blogspot.com

Bookmark and Share