Re: pgindent messing up "translator: " comments

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgtranslation-translators(at)pgfoundry(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgindent messing up "translator: " comments
Date: 2011-09-05 20:26:03
Message-ID: 1315253646-sup-2237@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excerpts from Tom Lane's message of lun sep 05 16:43:32 -0300 2011:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> > I think the proper fix would be to use the /*---- trick, such as in
> > postmaster.c:
>
> > /*------
> > translator: %s is a noun phrase describing a child process, such as
> > "server process" */
> > (errmsg("%s (PID %d) exited with exit code %d",
> > procname, pid, WEXITSTATUS(exitstatus))));
>
> Ugh. Are the gettext tools so broken that they force us to use that
> (very ugly IMO) layout for translator: comments? Why can't we get
> the tools fixed instead?
>
> By and large, the people who put in those comments don't know about any
> specialized restrictions that gettext might have on the layout of the
> comment; the only documentation I've ever seen just says that the
> comment has to start with "translator:":
> http://developer.postgresql.org/pgdocs/postgres/nls-programmer.html

Well, this is all the xgettext manpage says:

-cTAG, --add-comments=TAG
place comment blocks starting with TAG and preceding keyword lines in output file

I think nobody bothers to fix this because everyone else is using the
GNU indentation style, which would make the message look like this:

/* translator: %s is a noun phrase describing a child process,
such as "server process" */
errmsg( ... );

> I think that if gettext can't handle the comment as it stands, that's
> a gettext bug, not something that both pgindent and the human code
> authors ought to be subservient to. Or at the very least, I want to see
> an exact specification for what the allowed format is, and it had better
> not be very magical.

Hmm. I think the only other place than the above line in the manpage
where this is mentioned in the manual, is this:

http://www.gnu.org/software/gettext/manual/gettext.html#Bug-Report-Address

No mention of the format is done anywhere.

This seems related to this (unanswered) bug report:
http://savannah.gnu.org/bugs/?33451

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message hubert depesz lubaczewski 2011-09-05 20:35:56 Re: [GENERAL] pg_upgrade problem
Previous Message Tom Lane 2011-09-05 20:19:19 Re: Re: [COMMITTERS] pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge