Re: [PATCH 1/2] advice: extract function to print messages with prefix

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

 



Ralf Thielow <ralf.thielow@xxxxxxxxx> writes:

> On Fri, Sep 7, 2012 at 10:52 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> Ralf Thielow <ralf.thielow@xxxxxxxxx> writes:
>>
>>> On Fri, Sep 7, 2012 at 9:32 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>>>
>>>>> -             fprintf(stderr, _("hint: %.*s\n"), (int)(np - cp), cp);
>>>>> +             fprintf(stderr,  "%s %.*s\n", prefix, (int)(np - cp), cp);
>>>>
>>>> Hrm, naively, printf("%s: %.*s\n", _("hint"), ...) might look more
>>>> natural, but I vaguely recall that the current code places _()
>>>> around the entire "hint: %.*s\n" on purpose.  IIRC, it was to allow
>>>> translations that flow from RTL e.g. ".siht od t'nod :tnih".
>>>>
>>>> Doesn't this patch break it?
>>>
>>> Sorry but I don't know what you mean with "translations that flow
>>> from RTL e.g. ".siht od t'nod :tnih"." so I can't check this.
>>> As far as I can see the callers only put a simple message in it,
>>> e.g. advise(_("Commit your changes or stash them to proceed."));
>>> So I don't think that this patch would break anything.
>>
>> Your patch would not allow target languages that want to put the
>> _("hint") at the *tail* end of each line of the message.  With the
>> original, with something like this:
>>
>>         msgid "hint: %.*s\n"
>>         msgstr "%.*s :tnih\n"
>>
>> you could do that if you wanted to.
>
> Is there a need actually?
> It's easy to add a "_(...)" around this string, but then we'll have a
> msgid in "git.pot" without ever having a sensible translation. Not?

As I said "vaguely recall", even though I don't have a first-hand
experience in such a language, I know I was talked into doing it
this way when we did 23cb5bf (i18n of multi-line advice messages,
2011-12-22).  Could you dig around the list archive to see?
--
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]