Re: Enhancement Request: "locale" git option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 4, 2014 at 10:55 AM, Jeff King <peff@xxxxxxxx> wrote:
> On Thu, Dec 04, 2014 at 09:29:04AM +0100, Torsten Bögershausen wrote:
>
>> How about
>> alias git='LANGUAGE=de_DE.UTF-8 git'
>> in your ~/.profile ?
>> (Of course you need to change de to the language you want )
>
> Besides being awkward in scripts (which will not respect the alias and
> use a different language!), that variable will also be inherited by
> programs git spawns. So the editor, for example, may end up in the wrong
> language.
>
> I think respecting core.locale would make sense (probably the change
> would go into git_setup_gettext(), but you may have to fight with the
> setup code over looking at config so early in the process).

I think we should just stick to the standard *nix way of doing this:
Tell people to set their locale in their environment.

If someone's having this issue it's also happening for all the
binutils, and any other command-line and GUI program they use, unless
they override using the standard way of doing so, by setting the
relevant LC_* environment variables.

If you want Git in English then create an alias to override its locale
to be C, if you want the editor it spawns to be in some other language
alias that to something that explicitly sets LC_* for that editor.

Maybe I'm being overzealous about this (especially with the "I
implemented this" blinders on), but let's not have Git set the
precedent for other *nix programs that they all should come up with
some custom way to override locales, that's something to be done at
the OS locale library level, which we use.

> However, I think the original question is not one of localizing git, but
> rather of having it _not_ localized (avoiding the German translations).
> There is a hack you can do that for that, which is to set
> GIT_TEXTDOMAINDIR to something nonsensical (like "/"), which will mean
> git cannot find the .po files, and just uses the builtin messages.

You can, but the fact that that works is an internal implementation
detail we shouldn't document or support.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]