Re: problem with plural-forms

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: problem with plural-forms
Дата
Msg-id 12167.1243349718@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: problem with plural-forms  (Aidan Van Dyk <aidan@highrise.ca>)
Ответы Re: problem with plural-forms  (Aidan Van Dyk <aidan@highrise.ca>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: generic options for explain
Следующее
От: Aidan Van Dyk
Дата:
Сообщение: Re: problem with plural-forms