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

Re: [PATCH v3] i18n: notes: mark comment for translation

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 27, 2016, 19:33 UTC
Message-ID
<xmqq7fc6x4dw.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1469616819.1858.25.camel@sapo.pt>
Vasco Almeida <vascomalmeida@sapo.pt> writes:
Show 25 quoted lines
> A Ter, 26-07-2016 às 09:57 -0700, Junio C Hamano escreveu:
>> Vasco Almeida <vascomalmeida@sapo.pt> writes:
>> 
>> > 
>> > +		strbuf_add_commented_lines(&buf, "\n",
>> > strlen("\n"));
>> > +		strbuf_add_commented_lines(&buf, _(note_template),
>> > strlen(_(note_template)));
>> > +		strbuf_add_commented_lines(&buf, "\n",
>> > strlen("\n"));
>> 
>> Hmm, do we really need to make three separate calls?
>
> This patch does (1)
>
> #
> # Write/edit the notes for the following object:
> #
>
> The original source does (2)
>
> #
> # Write/edit the notes for the following object:
>
> How do we want, (1) or (2) ?
As I said earlier I was misreading the original one.

The input to strbuf_add_commented_lines() actually is a string that uses LF as a record terminator and asks the function to output each record on its own line prefixed with either "#" or "# ", so I should have considered the last LF as part of the second line.

In other words, the output should be as if you just did

- "\nWrite/edit the notes for the following object:\n"; + N_("\nWrite/edit the notes for the following object:\n");

in your patch, i.e. (2).
Thanks.
Previous: Vasco AlmeidaNext: Vasco Almeida
Message 9 of 11 in “i18n: notes: mark comment for translation”
  1. i18n: notes: mark comment for translationVasco Almeida, Jul 23, 2016
  2. Junio C HamanoJul 25, 2016
  3. Vasco AlmeidaJul 26, 2016
  4. Junio C HamanoJul 26, 2016
  5. Vasco AlmeidaJul 27, 2016
  6. i18n: notes: mark comment for translationVasco Almeida, Jul 26, 2016
  7. Junio C HamanoJul 26, 2016
  8. Vasco AlmeidaJul 27, 2016
  9. Junio C HamanoJul 27, 2016
  10. i18n: notes: mark comment for translationVasco Almeida, Jul 28, 2016
  11. Junio C HamanoJul 28, 2016

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.