Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git in Spanish after upgrade [duplicate]

After upgrading to git 2.19 the messages are in Spanish.

I don't have LANG set, but after setting it to English:

export LANG="en_US.UTF-8"

Then it works again, but before upgrade, it wasn't necessary to set up explicitly the language (what did it change the default recognition?)

UDPATE1:

https://github.com/Homebrew/homebrew-core/pull/32008

https://public-inbox.org/git/CAKd-JgS3omKbN+OzQL2dUun6Seg9CjDNk8KEj9m83xdTZE=7FA@mail.gmail.com/T/

This issue has been seen in other command-line as wget.

All point to be gettext() ?

UPDATE2:

https://github.com/Homebrew/homebrew-core/issues/31980 still researching gettext.

like image 581
devwebcl Avatar asked Sep 20 '18 18:09

devwebcl


1 Answers

There is a bug report in progress, as seen in this similar case

After update to Git 2.19 Git's output suddenly appeared in Russian.
I can use export LANG=en_US.UTF-8 to switch it to English back, but it's very weird.

this appears to be a bug in how brew changed its builds of Git, and also affects packages besides git.

This problem is not specific to Git.
Ævar asked if the problem also occurs with other command-line programs, and indeed it does.
For instance, I tried with 'wget' installed via brew, and it exhibits the same odd behavior.
Ævar suggested that there might be some magic special-casing English, which makes me wonder if brew builds such magic into gettext(?) or if the magic is part of MacOS itself.

Alexey Storozhev (storoj) comments in Homebrew/homebrew-core issue 31980

I totally agree with @moonfruit that removing --with-gettext option was a mistake.
But another mistake happened and gettext support became mandatory. It affects badly if your system has one or more languages.
For example, I have en_RU locale and my git output became Russian.
That's not an option for me and I can't help with it in a normal way;

  • I don't want to use LC_LANG=en_US in my bash_profile because it will affect everything in my system,
  • I don't want to make an alias like git="LC_LANG=en_US git" either.

Another point to return --with-gettext back is the way git supports i18n.
According to INSTALL, the only way to use English is exactly NO_GETTEXT flag enabled. Otherwise, po/${lang}.po files will be used to determine available languages.
As you see, that directory does not contain "en.po" file. And if you are running git with gettext support and en_RU locale, gettext will look for following files: share/locale/{en_RU,en,ru_RU,ru}/LC_MESSAGES/git.mo. It finally finds "ru" one and uses Russian language for output which is totally unusable. I don't have any piece of development software localized in Russian.

So... rebuilding Git with NO_GETTEXT=1 flag (disabling translations) seems to be the only workaround for now (Q4 2018).

like image 76
VonC Avatar answered Nov 11 '22 00:11

VonC