简体   繁体   中英

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? 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?

The reason behind this: the German output of mercurial is broken in a way that all special characters (Umlaute etc.) are not displayed correctly.

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 .

After creating it, your changes will only apply for new instances of cmd or other programs.

Note, that it seems that LANGUAGE env. variable is not something that most other programs pay any attention to, except for hg or TortoiseHg . I was able to install it in my Windows 7 box (English) and set 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.

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.

Now hg will fall back to the default language en

I'm guessing you used SET to set the environment variable. 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 ? 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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