Re: [PATCH 1/2] i18n: leave \n out of translated diffstat

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

 



On Mon, Jun 25, 2012 at 11:24 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Jonathan Nieder <jrnieder@xxxxxxxxx> writes:
>
>> Hi,
>>
>> Nguyễn Thái Ngọc Duy wrote:
>>
>>> GETTEXT_POISON scrapes everything in translated strings, including \n.
>>> t4205.12 however needs this \n in matching the end result. Keep this
>>> \n out of translation to make t4205.12 happy.
>> [...]
>>> --- a/diff.c
>>> +++ b/diff.c
>>> @@ -1397,7 +1397,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)
>>>
>>>      if (!files) {
>>>              assert(insertions == 0 && deletions == 0);
>>> -            return fputs(_(" 0 files changed\n"), fp);
>>> +            return fprintf(fp, "%s\n", _(" 0 files changed"));
>>
>> More importantly, this makes the string more similar to other
>> translated strings in the same file and saves translators from having
>> to remember to worry about appropriate whitespace at the end of the
>> string.
>>
>> Actually, it should be possible to make their lives even easier.  How
>> about this?
>>
>> diff --git i/diff.c w/diff.c
>> index 1a594df4..c53eea50 100644
>> --- i/diff.c
>> +++ w/diff.c
>> @@ -1395,11 +1395,6 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions)
>>       struct strbuf sb = STRBUF_INIT;
>>       int ret;
>>
>> -     if (!files) {
>> -             assert(insertions == 0 && deletions == 0);
>> -             return fputs(_(" 0 files changed\n"), fp);
>> -     }
>> -
>>       strbuf_addf(&sb,
>>                   Q_(" %d file changed", " %d files changed", files),
>>                   files);
>
> Yeah, I think that is going in the right direction.

That prints "0 files changed, 0 insertions(+), 0 deletions(-)" instead
of "0 files changed". Two more changed lines to make it the latter. I
don't mind either way, just checking which way you two and the list
prefer before I submit another patch.
-- 
Duy
--
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]