force locale that differs from OS current culture

  • Thread starter Thread starter Robert Ludig
  • Start date Start date
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?
 
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
 
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());
 
Back
Top