.NET Framework Ignores Regional Settings on WinXP

  • Thread starter Thread starter mirzas
  • Start date Start date
M

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
 
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?
 
I need .NET framework to use the system settings.

...Currency symbol, decimal separator and other culture specific stuff.
 
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/d.../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
 
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.
 
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.
 
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
 
Back
Top