How to set LANG variable in Windows?

自闭症网瘾萝莉.ら 提交于 2019-12-10 19:15:52

问题


I'm making an application that supports multi language. And I am using gettext and locale to solve this issue.

How to set LANG variable in Windows? In Linux and Unix-like systems it's just as simple as

$ LANG=en_US python appname.py

And it will automatically set the locale to that particular language. But in Windows, the

C:\>SET LANG=en_US python appname.py

or

C:\>SET LANG=en_US

C:\>python appname.py

doesn't work.


回答1:


Windows locale support doesn't rely on LANG variable (or, indeed, any other environmental variable). It is whatever the user set it to in Control Panel.




回答2:


you can use a batch file like in here: http://www.geany.org/Documentation/FAQ#QQuestions11

set LANG=en_US
something.exe

or set it through the control panel / system / advanced system settings / advanced / environmental variables



来源:https://stackoverflow.com/questions/1180590/how-to-set-lang-variable-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!