是否可以在运行时设置Windows程序的语言或语言环境? [英] Is it possible to set the language or locale of a Windows program at runtime?

查看:56
本文介绍了是否可以在运行时设置Windows程序的语言或语言环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一些现有软件(C ++ Windows应用程序)已将其资源翻译成多种语言,供各种客户使用.该应用程序从Windows区域设置中选择区域设置,并以适当的语言运行.

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.

根据最近的订单,我们将资源翻译成德语,但是我们发现客户正在以英语安装Windows,但希望我们的软件仍以德语运行.显然,PC上运行的其余软件尚未全球化,只有德语.

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.

Windows中是否有任何方法可以覆盖区域设置,以便软件认为它在德语安装的Windows上运行?我们现在没有时间对软件进行更改以覆盖区域设置,并且无论如何都不愿意为该客户分叉该应用程序.

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.

有什么建议吗?

推荐答案

我不知道任何不涉及更改程序的简单方法,但是我可以提供一种解决方法:

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

在运行您的应用的计算机上,创建另一个用户,并将该用户的语言区域设置为德语.然后,使用该用户的凭据运行程序(使用runas或psexec).然后,该程序将以德语语言环境运行,而用户将继续在英语环境中工作.但是,如果用户尝试保存或打开文件,这将很烦人-桌面和文档文件夹将是德语用户的文件夹,而不是英语用户的文件夹.

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.

这篇关于是否可以在运行时设置Windows程序的语言或语言环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆