Tue 06 May 2008 11:00:20 PM UTC, comment #1:
> If the translation of a plural form includes argument 2 but omits
> argument 1, msgfmt -c rejects it with the following error
> message:
>
> "msgstr[0]' is not a valid C format string, unlike 'msgid'.
> Reason: The string refers to argument number 2 but ignores
> argument number 1."
>
> This is incorrect
The error message is correct. A string like "une piece %$2s"
simply is not a valid C format string. When you pass it to
printf, printf produces an error code.
In C, a format string can choose to ignore the last argument,
however.
> in Arabic, omitting an argument in the translation is often
> the right thing to do. If the value of the argument is 0, 1
> or 2 (as determined by the gettext plural expression), the
> translation should reflect this value by using the appropriate
> the form of the Arabic word for "piece", rather than by
> including the number itself in the translation; therefore the
> translation will not refer to the argument.
Thank you for explaining. What you can do, is to ask the
programmer to swap the assignment of the argument numbers:
English singular:
%2$'d Piece @ %1$s
English plural:
%2$'d Pieces @ %1$s
Then you will be able to omit the reference to argument number
2, and "msgfmt -c" will accept it. (By "the programmer" I mean
the address listed in the Report-Msgid-Bugs-To field of the
PO file header.)
I will add a note about it to the gettext manual. Thank you
very much for bringing up this issue!
|