James
James

Reputation: 12182

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.

Upvotes: 7

Views: 3576

Answers (3)

jaxxon
jaxxon

Reputation: 131

If you want to change your command line language to english, go to your mercurial installation path (e.g. on windows C:\Program Files\Mercurial\) then /locale/ and rename the wrong current language folder (e.g. de) to _de.

Now hg will fall back to the default language en

Upvotes: 13

mvp
mvp

Reputation: 116197

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.

Upvotes: 10

RB.
RB.

Reputation: 37192

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.

Upvotes: 0

Related Questions