Am Mittwoch, 17. April 2013, 10:09:29 schrieb Thomas Rast:
> >> > msgid "The bundle contains this ref:"
> >> > msgid_plural "The bundle contains these %d refs:"
> >> >
> >> > -msgstr "Das Paket enthält %d Referenz"
> >> > -msgstr "Das Paket enthält %d Referenzen"
> >> > +msgstr "Das Paket enthält diese Referenz:"
> >> > +msgstr "Das Paket enthält diese %d Referenzen:"
> >> The msgstr 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 was correct; the
> >> English singular msgid
> >> is not.
> > That made me wonder, too. I've played around a bit with this, and it
> > seems to be OK as long as one of those strings contain at least one
> > format specifier.
> C printf() only knows about the number and types of arguments from the
> format string, so *ignoring* arguments is not a problem for correctness.
Indeed both of you are correct and I learned something new.
where the second answer quotes Online C Draft Standard (n1256), section
184.108.40.206, paragraph 2: "If the format is exhausted while arguments remain, the
excess arguments are evaluated (as always) but are otherwise ignored."
Hence, it is indeed safe to skip unneeded conversion specifiers both in
general ngettext messages and also in their respective translation. This is an
explanation which has yet to be added to ngettext's documentation.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html