Re: problem with plural-forms - Mailing list pgsql-hackers

From Tom Lane
Subject Re: problem with plural-forms
Date
Msg-id 12167.1243349718@sss.pgh.pa.us
Whole thread Raw
In response to Re: problem with plural-forms  (Aidan Van Dyk <aidan@highrise.ca>)
Responses Re: problem with plural-forms  (Aidan Van Dyk <aidan@highrise.ca>)
List pgsql-hackers
Aidan Van Dyk <aidan@highrise.ca> writes:
> From the glibc printf man page:
>    "There  may  be no gaps in the numbers of arguments specified using
>     '$'; for example, if arguments 1 and 3 are specified, argument 2 must
>     also be specified somewhere in the format string."

> So, is skipping 1 allowed?

No --- the point is that printf has to be able to figure out where each
argument is on the stack, so it must be able to infer the size of each
of the arguments from left to right.

> That said, I do think the "msgid" should be using the % args, not words
> for a few reasons:
> 1) Make it more clear for translators the arguments and their ordering
>    without having to visit the source code
> 2) On crufty systems without gettext, I wouldn't expect them to support m$
>    modifiers then either...
> 3) Greg's "these are numbers, not sentences" is how I expect the system
>    to work...

Actually, configure checks to see if the local printf supports m$ or
not, and we use our own printf implementation if not.  So I'm not
worried about #2.  I agree with your other points though.

(So, if you wanna see how this is done, try src/port/snprintf.c)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: generic options for explain
Next
From: Aidan Van Dyk
Date:
Subject: Re: problem with plural-forms