Обсуждение: Re: [COMMITTERS] pgsql: Fix some translator comments so that

Поиск
Список
Период
Сортировка

Re: [COMMITTERS] pgsql: Fix some translator comments so that

От
Bruce Momjian
Дата:
I looked at the first URL diff.  How is the pgindent output poor?

---------------------------------------------------------------------------

Peter Eisentraut wrote:
> Log Message:
> -----------
> Fix some translator comments so that xgettext finds them and pgindent does
> not destroy them.  Maybe we can adjust pgindent sometime.
> 
> Modified Files:
> --------------
>     pgsql/src/backend/parser:
>         parse_clause.c (r1.158 -> r1.159)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_clause.c.diff?r1=1.158&r2=1.159)
>         parse_coerce.c (r2.145 -> r2.146)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_coerce.c.diff?r1=2.145&r2=2.146)
>     pgsql/src/backend/postmaster:
>         postmaster.c (r1.503 -> r1.504)
>
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c.diff?r1=1.503&r2=1.504)
>     pgsql/src/backend/utils/error:
>         elog.c (r1.177 -> r1.178)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/elog.c.diff?r1=1.177&r2=1.178)
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faq

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: [COMMITTERS] pgsql: Fix some translator comments so that xgettext finds them and

От
Peter Eisentraut
Дата:
Bruce Momjian wrote:
> I looked at the first URL diff.  How is the pgindent output poor?

xgettext extracts comments if the first token of the comment is the tag 
we choose ("translator").  But if the comment is formatted like

/** translator: first %s is name of a SQL* construct, eg ORDER BY*/

then the first token of the comment is actually the second "*", so 
xgettext doesn't take it.

So we'd need a way for those comments to not be formatted that way.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: [COMMITTERS] pgsql: Fix some translator comments so that

От
Bruce Momjian
Дата:
Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > I looked at the first URL diff.  How is the pgindent output poor?
> 
> xgettext extracts comments if the first token of the comment is the tag 
> we choose ("translator").  But if the comment is formatted like
> 
> /*
>  * translator: first %s is name of a SQL
>  * construct, eg ORDER BY
>  */
> 
> then the first token of the comment is actually the second "*", so 
> xgettext doesn't take it.
> 
> So we'd need a way for those comments to not be formatted that way.

OK, next question.  Why does xgettext pull comments?  For the assistance
of the translator?

Looking at the diff, your new version uses "/*------" to mark the
comments --- that will prevent pgindent from modifying the comment, so
perhaps that is the right solution.  One thing we could do is look for
"/* translator" comments and manually change them.

--  Bruce Momjian   bruce@momjian.us EnterpriseDB    http://www.enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +