[docs] [issue25907] Documentation i18n: Added trans tags in sphinx templates

STINNER Victor report at bugs.python.org
Thu Jan 21 03:20:44 EST 2016


STINNER Victor added the comment:

The patch only changes Doc/tools/templates/indexcontent.html.

(Simplified) example of change on Doc/tools/templates/indexcontent.html:

   "<p>What's new in Python {{ version }}?</p>"

becomes

   "<p>{% trans %}What's new in Python {{ version }}?{% endtrans %}</p>"

I'm not a big fan of this option. Where does {% trans %}...{% endtrans %} format come from?

Is there an existing format to translate HTML templates?

I found html_translator_class config option in Sphinx:

http://www.sphinx-doc.org/en/stable/config.html?highlight=trans#confval-html_translator_class

Can't you avoid the new tags and use a small HTML parser to extract all strings?

----------
nosy: +ezio.melotti, haypo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25907>
_______________________________________


More information about the docs mailing list