public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail•com>
Cc: git@vger•kernel.org, Jeff King <peff@peff•net>
Subject: Re: [PATCH] Revert diffstat back to English
Date: Thu, 13 Sep 2012 11:40:12 -0700	[thread overview]
Message-ID: <7va9wt9377.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vzk4t960y.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 13 Sep 2012 10:39:09 -0700")

Junio C Hamano <gitster@pobox•com> writes:

> Nguyễn Thái Ngọc Duy <pclouds@gmail•com> writes:
>
>>  Git is still partly i18n-ized, turning a few strings back does not
>>  seem a big regression.
>
> More than one people explicitly said that they do not want to see
> this in Klingon.  Even if the system is fully internationalized,
> these "... (+), ... (-)" should never be localized, just like we
> will never localize "diff --git", "index f00f..abcd", etc.

Nah, I was being silly.  People complaining on Klingon on _this_
list does not argue for this to be in "C"; it just means the
i18n.projectlang for this project is "C".

How about _not_ reverting it and doing something like this instead?
I suspect that we may need to delay the call to git_setup_gettext()
in a similar way that we delay the call to commit_pager_choice(),
but that is a minor detail people smarter than I can surely figure
out ;-)

 git.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git i/git.c w/git.c
index 8788b32..a2cb9c8 100644
--- i/git.c
+++ w/git.c
@@ -51,6 +51,15 @@ int check_pager_config(const char *cmd)
 	return c.want;
 }
 
+static int project_lang_config(const char *var, const char *value, void *cb_data)
+{
+	if (!strcmp(var, "i18n.projectlang")) {
+		setenv("LANG", val, 1);
+		setenv("LC_ALL", val, 1);
+	}
+	return 0;
+}
+
 static void commit_pager_choice(void) {
 	switch (use_pager) {
 	case 0:
@@ -538,6 +547,7 @@ int main(int argc, const char **argv)
 	if (!cmd)
 		cmd = "git-help";
 
+	git_config(project_lang_config, NULL);
 	git_setup_gettext();
 
 	/*

  reply	other threads:[~2012-09-13 18:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-25 19:26 [PATCH RFC 0/2] Mixing English and a local language Nguyễn Thái Ngọc Duy
2012-08-25 19:26 ` [PATCH 1/2] Allow to print diffstat in English regardless current locale Nguyễn Thái Ngọc Duy
2012-08-25 19:26 ` [PATCH 2/2] format-patch: always print diffstat in English Nguyễn Thái Ngọc Duy
2012-09-12 14:05 ` [PATCH RFC 0/2] Mixing English and a local language Nguyen Thai Ngoc Duy
2012-09-12 18:18   ` Junio C Hamano
2012-09-13 13:28     ` Jeff King
2012-09-13 14:16       ` [PATCH] Revert diffstat back to English Nguyễn Thái Ngọc Duy
2012-09-13 14:57         ` Jeff King
2012-09-13 17:39         ` Junio C Hamano
2012-09-13 18:40           ` Junio C Hamano [this message]
2012-09-13 21:01             ` Jeff King
2012-09-13 21:10               ` Junio C Hamano
2012-09-13 21:20                 ` Jeff King
2012-09-13 21:26                   ` Junio C Hamano
2012-09-13 21:31                     ` Jeff King
2012-09-13 21:47                       ` Junio C Hamano
2012-09-14  0:11                         ` Jeff King
2012-09-14 11:56                           ` Nguyen Thai Ngoc Duy
2012-09-14 16:54         ` Junio C Hamano
2012-09-15  2:41           ` Nguyen Thai Ngoc Duy
2012-09-13 17:30       ` [PATCH RFC 0/2] Mixing English and a local language Junio C Hamano
2012-09-13 17:52         ` Junio C Hamano
2012-09-13 18:04           ` Jeff King
2012-09-13 18:00         ` Jeff King
2012-09-14 10:41           ` Michael J Gruber
2012-09-14 11:35             ` Nguyen Thai Ngoc Duy
2012-09-14 12:40               ` [PATCH] Makefile: respect $LINGUAS variable on selecting .mo files to install Nguyễn Thái Ngọc Duy
2012-09-14 13:06                 ` Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7va9wt9377.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pclouds@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox