[Numpy-discussion] Internationalization of numpy/scipy docstrings...

Ralf Gommers ralf.gommers at googlemail.com
Sun May 20 12:39:06 EDT 2012


On Sun, May 20, 2012 at 12:04 AM, Tim Cera <tim at cerazone.net> wrote:

> I have thought for a long time that it would be nice to have numpy/scipy
> docs in multiple languages.  I didn't have any idea how to do it until I
> saw http://sphinx.pocoo.org/intl.html.  The gettext builder which is a
> requirement to make this happen is relatively new to sphinx.
>
>
> Outline of above applied to numpy/scipy...
>
>
> 1. pydocweb would use the new gettext builder to convert *.rst to *.pot
> files.
>
> 2. Translators would use pootle to edit the *.pot files to *.po files
>
>    pydocweb or pootle would use mgsfmt to create *.mo files
>
> 3. From here can choose either:
>
>     a. Have pydocweb use sphinx-build to create new,
>
>        translated *.rst files from the *.mo files.
>
>        (my favorite since we would have *.rst files)
>
>     b. OR use gettext in Python to translate docstring
>
>        on-the-fly from the *.mo files.
>
>
> A user would then install a language kit, maybe something like scikits
> and access the translated docstring with a new 'np.info'.  As near as I
> can figure, Python 'help' command can't be replaced by something else, so
> 'help' would always display the English docstring.
>
>
> I have pydocweb and pootle setup locally and working.  Ran into a problem
> though with sphinx-build creating the initial *.pot files. It seems to be a
> problem with numpydoc.  It fails on 'function' and 'auto*' directives.  I
> tried to look at numpydoc and it is a bit of very intense coding and I
> frankly have not been able to find my way around.
>
>
> I am willing to put in some work for this to happen. My block right now is
> getting the initial *.pot files.
>
>
> Any interest?
>

Are you thinking only about documentation in .rst files (like the
tutorials), or also the docstrings themselves? The former may be feasible,
the latter I think will be difficult.

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120520/fe19cd89/attachment.html>


More information about the NumPy-Discussion mailing list