git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 7, 2012, 20:52 UTC
Message-ID
<7vfw6two6o.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAN0XMOK5QnNn8471RF4y7u_X0rfda=-J-KrCtyMsgCGHXNrwVw@mail.gmail.com>
Ralf Thielow <ralf.thielow@gmail.com> writes:
Show 17 quoted lines
> On Fri, Sep 7, 2012 at 9:32 PM, Junio C Hamano <gitster@pobox.com> 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.
Previous: Ralf ThielowNext: Ralf Thielow
Message 14 of 18 in “l10n: de.po: translate 2 new messages”
  1. l10n: de.po: translate 2 new messagesRalf Thielow, Sep 5, 2012
  2. Ralf ThielowSep 5, 2012
  3. Thomas RastSep 6, 2012
  4. Ralf ThielowSep 6, 2012
  5. Jiang XinSep 7, 2012
  6. Ralf ThielowSep 7, 2012
  7. Ralf ThielowSep 7, 2012
  8. Ralf ThielowSep 7, 2012
  9. Junio C HamanoSep 7, 2012
  10. 0/2 multiline prefixes on messagesRalf Thielow, Sep 7, 2012
  11. 1/2 advice: extract function to print messages with prefixRalf Thielow, Sep 7, 2012
  12. Junio C HamanoSep 7, 2012
  13. Ralf ThielowSep 7, 2012
  14. Junio C HamanoSep 7, 2012
  15. Ralf ThielowSep 7, 2012
  16. Junio C HamanoSep 7, 2012
  17. Junio C HamanoSep 7, 2012
  18. 2/2 i18n: mark prefix "warning:" for translationRalf Thielow, Sep 7, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.