From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Aidan Van Dyk <aidan(at)highrise(dot)ca> |
Cc: | Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com> |
Subject: | Re: problem with plural-forms |
Date: | 2009-05-26 14:55:18 |
Message-ID: | 12167.1243349718@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Aidan Van Dyk <aidan(at)highrise(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Aidan Van Dyk | 2009-05-26 15:02:42 | Re: problem with plural-forms |
Previous Message | Andrew Dunstan | 2009-05-26 14:54:54 | Re: generic options for explain |