* Helge Kreutzmann <[email protected]>, 2013-05-31, 17:56:
Please add a framework for providing localized man pages, possibly using po4a or similar tools.

I don't plan to add such a framework upstream, at least for the time being. Of course, the Debian maintainer is free to implement it on his own if he wishes so. :)

However, po4a currently does not support your native format (i.e. reStructuredText), so either you base the translation off the generated man page

I played with po4a a bit, and I run into a few problems:

1) po4a doesn't support ".de1" requests, which is what rst2man uses:
http://bugs.debian.org/710678

2) rst2man translates ' to \(aq, which is then left intact by po4a. I think that would be nuisance to translators. I wanted to use --smart-quotes to work around this problem, but that didn't work:
http://bugs.debian.org/712284

3) po4a puts wrong timezone to POT-Creation-Date:
http://bugs.debian.org/710695

Fortunately 1) and 2) are easy to work around. With i18nspector 0.10 (hopefully to be released over this weekend), it'll be possible convert the manpage to a PO file using these options:

po4a-gettextize -M UTF-8 -f man -o groff_code=verbatim -o 
unknown_macros=untranslated

The resulting file will contain quite a few messages that are not supposed to be translated, like tag names. They can be easily filtered out by msggrep:

msggrep -v -X -E -e '^type: (SS|IP|TH)$'

or you check with the po4a maintainers to get reStructuredText included.

A few months ago someone proposed a patch to add minimal support for reST:
https://lists.alioth.debian.org/pipermail/po4a-devel/2012-November/002158.html
I haven't tried the patch in practice, but I have I hunch that it wouldn't work reasonably well...

There's yet another approach possible. Sphinx, which can be used as a reST->man converter, supports translations:
http://sphinx-doc.org/latest/intl.html#internationalization

I played with it too, but I wasn't impressed with the results:
https://bitbucket.org/birkenfeld/sphinx/issue/1182
https://bitbucket.org/birkenfeld/sphinx/issue/1183
https://bitbucket.org/birkenfeld/sphinx/issue/1192

--
Jakub Wilk


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to