简体   繁体   English

如何在Windows上永久更改mercurial命令行的语言?

[英]How to permanently change the language of mercurial command line on Windows?

How can I change the language of the mercurial command line permanently to english on Windows? 如何在Windows上将mercurial命令行的语言永久更改为英语? Setting the LANG environment variable as described in this answer helps temporarily for one command window, but can the language be set somehow in mercurial.ini (or hgrc) or somehow else? 按照本答案中的描述设置LANG环境变量可以暂时帮助一个命令窗口,但语言是否可以在mercurial.ini(或hgrc)中以某种方式设置或以其他方式设置?

The reason behind this: the German output of mercurial is broken in a way that all special characters (Umlaute etc.) are not displayed correctly. 这背后的原因:德国的mercurial输出被打破,所有特殊字符(Umlaute等)都没有正确显示。

You can set LANGUAGE environment variable to en_US.UTF-8 either for current user or globally using Control Panel -> All Control Panel Items -> System -> Advanced system settings -> Advanced -> Environment variables , create new variable in User or System . 您可以使用Control Panel - > All Control Panel Items - > System - > Advanced system settings - > Advanced - > Environment variables ,为当前用户或全局设置LANGUAGE环境变量为en_US.UTF-8 ,在UserSystem创建新变量。

After creating it, your changes will only apply for new instances of cmd or other programs. 创建后,您的更改将仅适用于cmd或其他程序的新实例。

Note, that it seems that LANGUAGE env. 注意,看来LANGUAGE env。 variable is not something that most other programs pay any attention to, except for hg or TortoiseHg . 变量不是大多数其他程序关注的东西,除了hgTortoiseHg I was able to install it in my Windows 7 box (English) and set LANGUAGE=de_DE.UTF-8 . 我能够在我的Windows 7框中安装它(英文)并设置LANGUAGE=de_DE.UTF-8 This has changed hg to report most messages in German, but it did not affect any other of my programs - they still speak English. 这已经改变了hg以报告德语中的大多数消息,但它并没有影响我的任何其他程序 - 他们仍然会说英语。

If you want to change your command line language to english, go to your mercurial installation path (eg on windows C:\\Program Files\\Mercurial\\ ) then /locale/ and rename the wrong current language folder (eg de) to _de. 如果要将命令行语言更改为英语,请转到mercurial安装路径(例如,在Windows C:\\Program Files\\Mercurial\\ ),然后/locale/并将错误的当前语言文件夹(例如de)重命名为_de。

Now hg will fall back to the default language en 现在hg将回退到默认语言en

I'm guessing you used SET to set the environment variable. 我猜你用SET来设置环境变量。 This will only modify the variable for the lifetime of the current command window. 这只会修改当前命令窗口生命周期的变量。

Have you tried setting the LANG environment variable permanently using SETX ? 您是否尝试使用SETX永久设置LANG环境变量? This will modify the variable permanently. 这将永久修改变量。 However, please note that it will not modify the current command window, so you will need to open a new command window to see the effect of the change. 但请注意,它不会修改当前的命令窗口,因此您需要打开一个新的命令窗口以查看更改的效果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM