# [PATCH] i18n: diff/apply statistics

5 messages from 2012-02-01 to 2012-02-03. Participants: Jiang Xin, Nguyen Thai Ngoc Duy.
Thread: https://gitlist.dev/t/29503

## Jiang Xin, 2012-02-01 17:22

Subject: [PATCH] i18n: diff/apply statistics
Message-ID: <1328116977-61458-1-git-send-email-worldhello.net@gmail.com>
URL: https://gitlist.dev/e/1328116977-61458-1-git-send-email-worldhello.net%40gmail.com

```
translate oneline statistics of diff/apply.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
---
 builtin/apply.c |    2 +-
 diff.c          |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin/apply.c b/builtin/apply.c
index c24d..e289e 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -3241,7 +3241,7 @@ static void stat_patch_list(struct patch *patch)
 		show_stats(patch);
 	}
 
-	printf(" %d files changed, %d insertions(+), %d deletions(-)\n", files, adds, dels);
+	printf(_(" %d files changed, %d insertions(+), %d deletions(-)\n"), files, adds, dels);
 }
 
 static void numstat_patch_list(struct patch *patch)
diff --git a/diff.c b/diff.c
index 7e1542..b9115 100644
--- a/diff.c
+++ b/diff.c
@@ -1476,7 +1476,7 @@ static void show_stats(struct diffstat_t *data, struct diff_options *options)
 	}
 	fprintf(options->file, "%s", line_prefix);
 	fprintf(options->file,
-	       " %d files changed, %d insertions(+), %d deletions(-)\n",
+	       _(" %d files changed, %d insertions(+), %d deletions(-)\n"),
 	       total_files, adds, dels);
 }
 
@@ -1507,7 +1507,7 @@ static void show_shortstats(struct diffstat_t *data, struct diff_options *option
 				options->output_prefix_data);
 		fprintf(options->file, "%s", msg->buf);
 	}
-	fprintf(options->file, " %d files changed, %d insertions(+), %d deletions(-)\n",
+	fprintf(options->file, _(" %d files changed, %d insertions(+), %d deletions(-)\n"),
 	       total_files, adds, dels);
 }
 
-- 
1.7.9.3.g1fbd7

```

## Nguyen Thai Ngoc Duy, 2012-02-02 14:40

Subject: Re: [PATCH] i18n: diff/apply statistics
Message-ID: <CACsJy8DrNHwLGJjj4nJHDm-NEsr6c=QW-kgxmTbsRxq057keWQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8DrNHwLGJjj4nJHDm-NEsr6c%3DQW-kgxmTbsRxq057keWQ%40mail.gmail.com
In-Reply-To: <1328116977-61458-1-git-send-email-worldhello.net@gmail.com>

```
On Thu, Feb 2, 2012 at 12:22 AM, Jiang Xin <worldhello.net@gmail.com> wrote:
> translate oneline statistics of diff/apply.

There's another patch with similar goal:

http://thread.gmane.org/gmane.comp.version-control.git/189453/focus=189509
-- 
Duy

```

## Jiang Xin, 2012-02-03 01:15

Subject: Re: [PATCH] i18n: diff/apply statistics
Message-ID: <CANYiYbFBDtK5SiYZV41vWxjjQw3GT4+9kcESpV69sNDWgZ26QQ@mail.gmail.com>
URL: https://gitlist.dev/e/CANYiYbFBDtK5SiYZV41vWxjjQw3GT4%2B9kcESpV69sNDWgZ26QQ%40mail.gmail.com
In-Reply-To: <CACsJy8DrNHwLGJjj4nJHDm-NEsr6c=QW-kgxmTbsRxq057keWQ@mail.gmail.com>

```
2012/2/2 Nguyen Thai Ngoc Duy <pclouds@gmail.com>:
> On Thu, Feb 2, 2012 at 12:22 AM, Jiang Xin <worldhello.net@gmail.com> wrote:
>> translate oneline statistics of diff/apply.
>
> There's another patch with similar goal:
>
> http://thread.gmane.org/gmane.comp.version-control.git/189453/focus=189509

It's cool, especially the call of interactive_use, so that
translations for the statistics line is only for human, not for scripts/pipe...

--
Jiang Xin

```

## Jiang Xin, 2012-02-03 01:23

Subject: Re: [PATCH] i18n: diff/apply statistics
Message-ID: <CANYiYbHtJMw25ZDbYRbe8S_GM-gR6okkDwwNXo_yxPhPrHQp+w@mail.gmail.com>
URL: https://gitlist.dev/e/CANYiYbHtJMw25ZDbYRbe8S_GM-gR6okkDwwNXo_yxPhPrHQp%2Bw%40mail.gmail.com
In-Reply-To: <CACsJy8DfdTPfwZJq1_=RzO_f67FoLGJ1Q__Qfqtg+HxKZEMp4g@mail.gmail.com>

```
2012/2/3 Nguyen Thai Ngoc Duy <pclouds@gmail.com>:
> On Fri, Feb 3, 2012 at 8:12 AM, Jiang Xin <worldhello.net@gmail.com> wrote:
>> 2012/2/2 Nguyen Thai Ngoc Duy <pclouds@gmail.com>:
>>>
>>> There's another patch with similar goal:
>>>
>>> http://thread.gmane.org/gmane.comp.version-control.git/189453/focus=189509
>>
>> It's cool, especially the call of interactive_use, so that
>> translations for the statistics line is only for human, not for scripts/pipe...
>
> That's the idea but they decided to allow translations unconditionally
> in the end.

Ohh, sad, not so cool. Are there any reasons?

-- 
Jiang Xin

```

## Nguyen Thai Ngoc Duy, 2012-02-03 01:28

Subject: Re: [PATCH] i18n: diff/apply statistics
Message-ID: <CACsJy8BksBhzu2cHNEr5S7u7dhsavBHm9e6fnPvdD31sr_d+gw@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8BksBhzu2cHNEr5S7u7dhsavBHm9e6fnPvdD31sr_d%2Bgw%40mail.gmail.com
In-Reply-To: <CANYiYbHtJMw25ZDbYRbe8S_GM-gR6okkDwwNXo_yxPhPrHQp+w@mail.gmail.com>

```
On Fri, Feb 3, 2012 at 8:23 AM, Jiang Xin <worldhello.net@gmail.com> wrote:
> 2012/2/3 Nguyen Thai Ngoc Duy <pclouds@gmail.com>:
>> On Fri, Feb 3, 2012 at 8:12 AM, Jiang Xin <worldhello.net@gmail.com> wrote:
>>> 2012/2/2 Nguyen Thai Ngoc Duy <pclouds@gmail.com>:
>>>>
>>>> There's another patch with similar goal:
>>>>
>>>> http://thread.gmane.org/gmane.comp.version-control.git/189453/focus=189509
>>>
>>> It's cool, especially the call of interactive_use, so that
>>> translations for the statistics line is only for human, not for scripts/pipe...
>>
>> That's the idea but they decided to allow translations unconditionally
>> in the end.
>
> Ohh, sad, not so cool. Are there any reasons?
>

Inconsistency mainly. I don't see anything sad about that though. You
should read that thread.
-- 
Duy

```
