11

My git cli switched to russian after brew upgrade. I've tried to find why, or how, but no clue.

$ git --version
git version 2.19.0

How do I fix this!?

My locale doesn't mention russian at all

$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
Jaap
  • 3,081
  • 2
  • 29
  • 50
  • I don't have an answer, but on the bright side, if you ever land a software job in Moscow, you'll be ahead of the game :-) – Tim Biegeleisen Sep 20 '18 at 14:02
  • 4
    What does `echo $LANG` print? Does running `export LANG="en_US.UTF-8"` (or some other English locale) fix your issue? – jub0bs Sep 20 '18 at 14:05
  • Related/dupe: https://stackoverflow.com/questions/11540815/how-to-change-the-language-of-my-git – jub0bs Sep 20 '18 at 14:05
  • @jujobs $LANG was empty, but setting it helped. Strange that it somehow changed with upgrading to a new version... – Jaap Sep 20 '18 at 14:36

3 Answers3

12

It happened because of removing "NO_GETTEXT=1" line here: https://github.com/Homebrew/homebrew-core/commit/2049390786eff5dd50862ee63ddca822dc138c64.

I think setting LC_* is not an option that's why I recommend either remove /usr/local/Cellar/git/{version}/share/locale/es directory or rebuild git from sources.

If you want to rebuild git from sources you need to edit homebrew git formula:

$ brew uninstall git
$ brew edit git

<<<
- depends_on "gettext"
+ depends_on "gettext" => :optional
<<<
- args = %W[
+ ENV["NO_GETTEXT"] = "1" if build.without? "gettext"
+
+ args = %W[
<<<
:wq

$ brew install -s git

then your git will be built with NO_GETTEXT=1 flag that disables translations.

Hope it will help.

I have commented corresponding thread with that issue: https://github.com/Homebrew/homebrew-core/issues/31980#issuecomment-425894125. Voting may help to fix it.

Eloy Pineda
  • 2,117
  • 17
  • 22
storoj
  • 1,851
  • 2
  • 18
  • 25
  • 3
    Great, thanks. Because secondary translations were moving me crazy. Living with a temp solution of `export LANG="en_US.UTF-8` – Xentatt Oct 02 '18 at 08:39
  • 3
    In my case I had to modify `depends_on "gettext" :optional` by `depends_on "gettext" => :optional` – marian0 Nov 12 '18 at 12:13
2

A simple workaround is to add the following line to your ~/.bashrc or ~/.zshrc file:

alias git="LANG=\"en_US.UTF-8\" git"

Then execute source ~/.bashrc (or source ~/.zshrc) and voila :)

JustAC0der
  • 2,871
  • 3
  • 32
  • 35
0

I added to ~/.bash_profile:

alias git="LANG=\"en_US.UTF-8\" git"

Then execute source ~/.bash_profile and git is in English at Terminal.

Ivo Dimitrov
  • 103
  • 7