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

Re: [PATCH/RFC] l10n: de.po: translate 39 new messages

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 17, 2013, 23:02 UTC
Message-ID
<7v4nf4ep73.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1906942.3yyCMUNxTB@cs-pc>
Christian Stimming <stimming@tuhh.de> writes:
Show 27 quoted lines
> Thanks for the regular update! This is great work.
>
> One issue with the plural form messages, though:
>
> Am Montag, 15. April 2013, 18:27:40 schrieb Ralf Thielow:
>>  #: bundle.c:186
>> -#, fuzzy, c-format
>> +#, c-format
>>  msgid "The bundle contains this ref:"
>>  msgid_plural "The bundle contains these %d refs:"
>> -msgstr[0] "Das Paket enthält %d Referenz"
>> -msgstr[1] "Das Paket enthält %d Referenzen"
>> +msgstr[0] "Das Paket enthält diese Referenz:"
>> +msgstr[1] "Das Paket enthält diese %d Referenzen:"
>
> The msgstr[0] must still contain a %d conversion specifier (which will be 
> filled with the number 1) even though the translated sentence wouldn't need 
> the 1 anymore. The previous msgstr[0] was correct; the English singular msgid 
> is not.
>
> Technical background: The ngettext function chooses only the string itself, 
> which will then be fed to printf() as a second step. If the printf sees more 
> variadic arguments than conversion specifiers in the string, it will be 
> unhappy. At least that's what I remembered about the ngettext things...
>
> http://www.gnu.org/software/libc/manual/html_node/Advanced-gettext-
> functions.html
This vaguely sounds familiar:
  http://thread.gmane.org/gmane.comp.version-control.git/218173
  http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms

In the English singular case, the number – always 1 – can be replaced with "one":

          printf (ngettext ("One file removed", "%d files removed", n), n);

This works because the ‘printf’ function discards excess arguments that are not consumed by the format string.

Previous: Ralf ThielowNext: Thomas Rast
Message 4 of 10 in “l10n: de.po: translate 39 new messages”
  1. l10n: de.po: translate 39 new messagesRalf Thielow, Apr 15, 2013
  2. Christian StimmingApr 15, 2013
  3. Ralf ThielowApr 17, 2013
  4. Junio C HamanoApr 17, 2013
  5. Thomas RastApr 16, 2013
  6. Ralf ThielowApr 17, 2013
  7. Thomas RastApr 17, 2013
  8. [PATCHv2] l10n: de.po: translate 39 new messagesRalf Thielow, Apr 18, 2013
  9. Thomas RastApr 17, 2013
  10. Christian StimmingApr 17, 2013

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.