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

Re: [RFC/PATCH] i18n of multi-line messages

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Dec 22, 2011, 11:56 UTC
Message-ID
<m2r4zw4y6j.fsf@igel.home>
In-Reply-To
<4EF30907.8070101@gmail.com>
Chris Packham <judge.packham@gmail.com> writes:
Show 24 quoted lines
> Hi Junio,
>
> On 12/22/2011 08:38 PM, Junio C Hamano wrote:
>> +	for (cp = buf.buf; *cp; cp = np) {
>> +		np = strchrnul(cp, '\n');
>> +		/*
>> +		 * TRANSLATORS: the format is designed so that in RTL
>> +		 * languages you could reorder and put the "prefix" at
>> +		 * the end instead of the beginning of a line if you
>> +		 * wanted to.
>> +		 */
>> +		strbuf_addf(&line,
>> +			    _("%s: %.*s\n"),
>> +			    prefix,
>> +			    (int)(np - cp), cp);
>> +		emit(&line, cb_data);
>> +		strbuf_reset(&line);
>> +		if (*np)
>> +			np++;
>> +	}
>
> Forgive my ignorance if I've missed something, but how is this going to
> work for RTL languages? Translators can change the format string but
> they can't change the order of parameters passed to strbuf_addf.

Translations can select the parameters to use with the n$ specification, eg. "%3$.*2$s: %$1s\n"

Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Chris PackhamNext: Ævar Arnfjörð Bjarmason
Message 14 of 15 in “i18n of multi-line messages”
  1. i18n of multi-line messagesJunio C Hamano, Dec 21, 2011
  2. Ævar Arnfjörð BjarmasonDec 22, 2011
  3. Junio C HamanoDec 22, 2011
  4. Thomas RastDec 22, 2011
  5. Johannes SixtDec 22, 2011
  6. Junio C HamanoDec 22, 2011
  7. Junio C HamanoDec 22, 2011
  8. Junio C HamanoDec 22, 2011
  9. Johannes SixtDec 22, 2011
  10. Junio C HamanoDec 22, 2011
  11. Johannes SixtDec 23, 2011
  12. Junio C HamanoDec 23, 2011
  13. Chris PackhamDec 22, 2011
  14. Andreas SchwabDec 22, 2011
  15. Ævar Arnfjörð BjarmasonDec 22, 2011

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.