windowsruntimelocale

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?


Solution

  • I don't know of any straightforward way that does not involve changing your program, but I can offer the following workaround.

    On the machines where your app is running:

    1. create another user
    2. set that user's locale to German
    3. 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.

    Drawbacks

    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.