force locale that differs from OS current culture

R

Robert Ludig

In some scenarios I need to be able run my app in a different culture
than the one currently active in the OS. For example my app has to
display datetime formats, menu/dialogtexts and common dialogs (such as
the save as dialog) in englisch while the current culture of the OS is
set to german.
These apps are written using Windows Forms 2.0.

What are the best practises to solve such a scenario?
 
G

Guest

Hi,
Search for following strings(" c# multiple culture language globalization")
in the google and you will find tons of article on this topic.

Thanks and Regards,
manish bafna
 
R

Rad [Visual C# MVP]

In some scenarios I need to be able run my app in a different culture
than the one currently active in the OS. For example my app has to
display datetime formats, menu/dialogtexts and common dialogs (such as
the save as dialog) in englisch while the current culture of the OS is
set to german.
These apps are written using Windows Forms 2.0.

What are the best practises to solve such a scenario?

One way is to set the current culture of the executing thread like so:

To run under US English

Thread.CurrentThread.CurrentCulture=new
System.Globalization.CultureInfo("en-us");

To run under UK English

Thread.CurrentThread.CurrentCulture=new
System.Globalization.CultureInfo("en-gb");
WL(DateTime.Now.ToLongTimeString());
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top