Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: add option to enable i18n support #32008

Closed
wants to merge 3 commits into from
Closed

git: add option to enable i18n support #32008

wants to merge 3 commits into from

Conversation

moonfruit
Copy link
Contributor

  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install <formula>)?

Fix for #31980

@fxcoudert
Copy link
Member

I'd rather make it non-optional (i.e. mandatory) so all users can benefit from it.

@fxcoudert fxcoudert added the maintainer feedback Additional maintainers' opinions may be needed label Sep 12, 2018
@lembacon
Copy link
Member

👍 on making gettext a mandatory dependency.

@MikeMcQuaid
Copy link
Member

I would also support making gettext (and maybe even pcre2) mandatory

@sjackman
Copy link
Member

Fun chicken and egg problem on El Capitan. Host's git is too old, so it tries to install git by downloading the bottle, which doesn't exist, because it hasn't been created yet by this PR.
https://jenkins.brew.sh/job/Homebrew%20Core%20Pull%20Requests/30354/version=el_capitan/testReport/junit/brew-test-bot/el_capitan/install/

@fxcoudert fxcoudert closed this in 2049390 Sep 12, 2018
@dconnolly
Copy link
Contributor

gettext requires javac, which is a blocker on some systems, and wasn't a blocker to installing git before.

@golovnin
Copy link

I think this change was not fully tested. I use on my Mac multiple languages: English, German, Russian and Greek. The value of LC_CTYPE is en_US.UTF-8. Before this change all messages of GIT were in English. After this change GIT uses now Russian. It is not a big problem for me because I understand Russian. But it is not the right behaviour:
user:~ $ echo $LC_CTYPE
en_US.UTF-8
user:~ $ git --help
использование: git [--version] [--help] [-C <путь>] [-c <имя>=<значение>]
[--exec-path[=<путь>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<путь>] [--work-tree=<путь>] [--namespace=<имя>]
<команда> [<аргументы>]

Стандартные команды Git используемые в различных ситуациях:

@sjackman
Copy link
Member

Please report the output of locale and

LANG=en_US.UTF-8 git --version
LANG=ru_RU.UTF-8 git --version

@fxcoudert
Copy link
Member

@dconnolly gettext does not require javac. Java is disabled in Homebrew's gettext. If there is a specific issue, please open a ticket and we will look at it.

@golovnin
Copy link

user:~ $ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

user:~ $ LANG=en_US.UTF-8 git --version
git version 2.19.0
user:~ $ LANG=ru_RU.UTF-8 git --version
git version 2.19.0

user:~ $ LANG=en_US.UTF-8 git --help
usage: git [--version] [--help] [-C ] [-c =]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]

user:~ $ LANG=ru_RU.UTF-8 git --help
использование: git [--version] [--help] [-C <путь>] [-c <имя>=<значение>]
[--exec-path[=<путь>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<путь>] [--work-tree=<путь>] [--namespace=<имя>]
<команда> [<аргументы>]

@sjackman
Copy link
Member

Cool. Looks like it's working as expected. Use LANG to switch languages.

@golovnin
Copy link

Cool. Looks like it's working as expected.

Not from my point of view. I would expect that the primary language is used, as it is configured in the Mac OS preferences. I my case English is the primary language and Russian is the second language. But I think it is acceptable to set an environment variable. Thanks a lot!

@mreinsch
Copy link

@sjackman I'm experiencing similar issue. I'm using Mac set to English with German as second locale in Germany. After updating to this version of git, all messages are suddenly in German, while everything else is (as it should be) in English.

Also I'm at a loss from where git is taking the locale information. local for me also gives:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

So why does git use German?! Again, no other tool is using German locale.

@sjackman
Copy link
Member

I really can't say where it's getting the language configuration from. You can add to the file ~/.profile (or ~/.bash_profile if it already exists) the following:

export LANG=en_US.UTF-8

@darwin
Copy link

darwin commented Sep 15, 2018

Same problem here. Git (2.19.0_1) unexpectedly started talking to me in Spanish. brew switch git 2.19.0 fixed the issue.

In System Preferences > Language & Region I have "Preferred languages" in this order:

1. English - Primary
2. Czech
3. Spanish
> sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.6
BuildVersion:	17G65
> locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

@sjackman
Copy link
Member

Rather than switching to an older version of git, I'd suggested adding to your ~/.profile (or ~/.bash_profile if it already exists) the following:

export LANG=en_US.UTF-8

@darwin
Copy link

darwin commented Sep 17, 2018

Thanks for the suggestion. I understand that specifying LANG explicitly would solve the issue. But I'm not going to do that because AFAIK it is not standard setting on pristine macOS machine and this could interfere with other commands I would run.

To me it looks like an issue with git itself or somewhere someone wrongly interprets preferred languages list in preferences and taking the last option, instead of primary one.

@sjackman
Copy link
Member

sjackman commented Sep 17, 2018

Possibly it's a bug in either git or gettext or macOS. It's certainly odd. My current best guess would be possibly a bug in gettext.

@darwin
Copy link

darwin commented Sep 17, 2018

Sure. No worries. I can workaround it by setting a git alias which sets LANG for each git invocation. At least temporarily until this gets fixed. I'm afraid I'm not the last person who will complain here.

@inosik
Copy link

inosik commented Sep 21, 2018

I must admit I find this pretty annoying. I switch all my development tools to English, because the German translations tend to be rather horrible. And, you have a much harder time searching for error messages if they're translated.

@Homebrew Homebrew locked as off-topic and limited conversation to collaborators Sep 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintainer feedback Additional maintainers' opinions may be needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants