Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set the language or locale of a Windows program at runtime?

We have some existing software (C++ Windows applications) that have had their resources translated into a number of languages for various customers. The application picks up the locale from the Windows locale and runs in the appropriate language.

Following a recent order, we translated the resources into German, however we have just found out that the customers are installing Windows in English, but want our software to still run in German. Apparently the rest of the software running on the PC has not been globalized and is only German.

Is there any way in Windows that we can override the locale so that the software believes it is running on a German install of Windows? We do not now have time to make changes to the software to override the locale, and would be reluctant to fork the application for this one customer anyway.

Any suggestions?

like image 462
Jon Lawson Avatar asked Oct 14 '11 15:10

Jon Lawson


1 Answers

I don't know of any straightforward way that does not involve changing your program, but I can offer a workaround:

On the machines where your app is running, create another user, and set that user's locale to German. Then, have your program run with that user's credentials (using runas or psexec). The program will then run with the German locale, while the user will keep working on an English environment. This is going to be annoying, though, if the user tries to save or open files - the desktop and documents folder are going to be those of the German user rather than the English one.

like image 177
eran Avatar answered Oct 18 '22 03:10

eran