user31673
user31673

Reputation: 13695

CultureInfo not using computer settings

I changed the Windows XP Regional and Language Options to French (Canada) [fr-CA]. I have resource files that are definied in my application (Windows Forms) for "fr-CA". My dates and numbers are changed to format for fr-CA but my resource file for fr-CA is not being used. The only way to get the resource file to be read is to explicitly set the following:

Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-CA");

How can I get the thread to pick up the local machine's settings?

Upvotes: 0

Views: 1891

Answers (2)

andyp
andyp

Reputation: 6269

As the example in the MSDN states you can do it like this:

// Set the user interface to display in the same culture
// as that set in Control Panel.
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

Upvotes: 2

Lee
Lee

Reputation: 18757

Did you change the setting while the application is running? I'm pretty certain that setting is only read when the application starts unless you do something like you're talking about in code.

Upvotes: 0

Related Questions