View Single Post
Old 12-12-2006   #2 (permalink)
Laurent Bugnion


 
 

Re: force locale that differs from OS current culture

Hi,

Robert Ludig wrote:
> 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.
>
> What are the best practises to solve such a scenario in WPF?


Just like any other .NET application:

using System.Threading;
using System.Globalization;

//...

Thread.CurrentThread.CurrentCulture = new CultureInfo( "en-US" );
Thread.CurrentThread.CurrentUICulture = new CultureInfo( "en-US" );

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
My System SpecsSystem Spec