[I18n-sig] Re: pygettext.py extraction of docstrings

Karl Eichwalder keichwa@gmx.net
25 May 2001 07:11:57 +0200


barry@wooz.org (Barry A. Warsaw) writes:

> You probably know better than me, but, is that opinion based on more
> information than is available in the GNU gettext manual?

This is another piece of info you'll find within the gettext manual:

-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- cut here -=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
   Therefore the `xgettext' adds a special tag to those messages it
thinks might be a format string.  There is no absolute rule for this,
only a heuristic.  In the `.po' file the entry is marked using the
`c-format' flag in the `#,' comment line (*note PO Files::).

   The careful reader now might say that this again can cause problems.
The heuristic might guess it wrong.  This is true and therefore
`xgettext' knows about special kind of comment which lets the
programmer take over the decision.  If in the same line or the
immediately preceding line of the `gettext' keyword the `xgettext'
program find a comment containing the words `xgettext:c-format' it will
mark the string in any case with the `c-format' flag.  This kind of
comment should be used when `xgettext' does not recognize the string as
a format string but is really is one and it should be tested.  Please
note that when the comment is in the same line of the `gettext'
keyword, it must be before the string to be translated.
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- cut here -=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-

>     http://www.gnu.org/manual/gettext/html_node/gettext_9.html#SEC9
>=20
> seems to imply to me that #, comments define only two flags
> (i.e. "fuzzy" and "c-format" / "no-c-format") and it doesn't say that
> the flags are extensible or user definable.  Then again, it doesn't
> say that #. comments are reserved.  It basically just says that
> #-whitespace comments are reserved for the translators.

You're right.  The term AUTOMATIC-COMMENTS is not properly defined.

Also FLAG leave open some questions.

> I'm happy to switch it, but I'd really like to have a reference I can
> point to to short-circuit any further discussion.  Even a mailing list
> archive url would be fine.

It's now bruno Haible who maintains the gettext suite.  There's a
po-utils-forum mailinglist at IRO.UMontreal.CA initiated by Fran=E7ois
(thanks); mostly for my own amusement ;)

The mailinglist is archived -- at the moment I don't know where.  You
can start browsing here:

    http://www.iro.umontreal.ca/~pinard/po-utils/HTML/

But right now "titan" (Fran=E7ois' workstation?) does not want to talk to
me.  Please, try again later.

The other gettext forum is gnu.utils.bugs .

Karl

--=20
work : ke@suse.de                          |                   ,__o
     : http://www.suse.de/~ke/             |                 _-\_<,
home : keichwa@gmx.net                     |                (*)/'(*)