[I18n-sig] pygettext.py extraction of docstrings

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sat, 28 Oct 2000 00:28:56 +0200


> I have a tentative patch for Tools/i18n/pygettext.py which adds
> optional extraction of module, class, method, and function
> docstrings.  Francois Pinard's po-utils does something similar I
> believe, and it makes a lot of sense to add this.

It certainly does. One question though:

> +    --docstrings
> +        Extract module, class, method, and function docstrings.  This requires
> +        an import of the specified module, so beware of import side effects.

It's probably too late tonight to analyse tricky Python code - but
where exactly does that import the module?

> One question: should docstring extraction be turned on my default?

I'd say so, yes. People who are confronted with gettext for the first
time will say "Wow, it even does that!". In the rare cases where doc
strings would confuse the meat of the catalog, people will be able to
turn that off.  Perhaps it may be good to indicate in the catalog that
this is a doc string? I'm thinking of

#, py-doc

I don't know the exact specification of the #, comments, but it can
look like

#, c-format, fuzzy

i.e. it appears to be a comma-separated list of informative
flags. Translators could then decide to deal with doc strings in a
different manner (e.g follow different grammatical conventions).

Regards,
Martin