Browse Source
doc: i18n HTML templates
doc: i18n HTML templates
Issue #25907: Use {% trans %} tags in HTML templates to ease the translation of the documentation. The tag comes from Jinja templating system, used by Sphinx. Patch written by Julien Palard.pull/9921/head
3 changed files with 59 additions and 59 deletions
-
78Doc/tools/templates/indexcontent.html
-
22Doc/tools/templates/indexsidebar.html
-
18Doc/tools/templates/layout.html
@ -1,59 +1,59 @@ |
|||
{% extends "defindex.html" %} |
|||
{% block tables %} |
|||
<p><strong>Parts of the documentation:</strong></p> |
|||
<p><strong>{% trans %}Parts of the documentation:{% endtrans %}</strong></p> |
|||
<table class="contentstable" align="center"><tr> |
|||
<td width="50%"> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">What's new in Python {{ version }}?</a><br/> |
|||
<span class="linkdescr">or <a href="{{ pathto("whatsnew/index") }}">all "What's new" documents</a> since 2.0</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">Tutorial</a><br/> |
|||
<span class="linkdescr">start here</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("library/index") }}">Library Reference</a><br/> |
|||
<span class="linkdescr">keep this under your pillow</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">Language Reference</a><br/> |
|||
<span class="linkdescr">describes syntax and language elements</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup and Usage</a><br/> |
|||
<span class="linkdescr">how to use Python on different platforms</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTOs</a><br/> |
|||
<span class="linkdescr">in-depth documents on specific topics</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">{% trans %}What's new in Python {{ version }}?{% endtrans %}</a><br/> |
|||
<span class="linkdescr"> {% trans whatsnew_index=pathto("whatsnew/index") %}or <a href="{{ whatsnew_index }}">all "What's new" documents</a> since 2.0{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">{% trans %}Tutorial{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}start here{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("library/index") }}">{% trans %}Library Reference{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}keep this under your pillow{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">{% trans %}Language Reference{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}describes syntax and language elements{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">{% trans %}Python Setup and Usage{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}how to use Python on different platforms{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">{% trans %}Python HOWTOs{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}in-depth documents on specific topics{% endtrans %}</span></p> |
|||
</td><td width="50%"> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("installing/index") }}">Installing Python Modules</a><br/> |
|||
<span class="linkdescr">installing from the Python Package Index & other sources</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("distributing/index") }}">Distributing Python Modules</a><br/> |
|||
<span class="linkdescr">publishing modules for installation by others</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("extending/index") }}">Extending and Embedding</a><br/> |
|||
<span class="linkdescr">tutorial for C/C++ programmers</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("c-api/index") }}">Python/C API</a><br/> |
|||
<span class="linkdescr">reference for C/C++ programmers</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("faq/index") }}">FAQs</a><br/> |
|||
<span class="linkdescr">frequently asked questions (with answers!)</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("installing/index") }}">{% trans %}Installing Python Modules{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}installing from the Python Package Index & other sources{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("distributing/index") }}">{% trans %}Distributing Python Modules{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}publishing modules for installation by others{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("extending/index") }}">{% trans %}Extending and Embedding{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}tutorial for C/C++ programmers{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("c-api/index") }}">{% trans %}Python/C API{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}reference for C/C++ programmers{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("faq/index") }}">{% trans %}FAQs{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}frequently asked questions (with answers!){% endtrans %}</span></p> |
|||
</td></tr> |
|||
</table> |
|||
|
|||
<p><strong>Indices and tables:</strong></p> |
|||
<p><strong>{% trans %}Indices and tables:{% endtrans %}</strong></p> |
|||
<table class="contentstable" align="center"><tr> |
|||
<td width="50%"> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("py-modindex") }}">Global Module Index</a><br/> |
|||
<span class="linkdescr">quick access to all modules</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">General Index</a><br/> |
|||
<span class="linkdescr">all functions, classes, terms</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("glossary") }}">Glossary</a><br/> |
|||
<span class="linkdescr">the most important terms explained</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("py-modindex") }}">{% trans %}Global Module Index{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}quick access to all modules{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">{% trans %}General Index{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}all functions, classes, terms{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("glossary") }}">{% trans %}Glossary{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}the most important terms explained{% endtrans %}</span></p> |
|||
</td><td width="50%"> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("search") }}">Search page</a><br/> |
|||
<span class="linkdescr">search this documentation</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Complete Table of Contents</a><br/> |
|||
<span class="linkdescr">lists all sections and subsections</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("search") }}">{% trans %}Search page{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}search this documentation{% endtrans %}</span></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">{% trans %}Complete Table of Contents{% endtrans %}</a><br/> |
|||
<span class="linkdescr">{% trans %}lists all sections and subsections{% endtrans %}</span></p> |
|||
</td></tr> |
|||
</table> |
|||
|
|||
<p><strong>Meta information:</strong></p> |
|||
<p><strong>{% trans %}Meta information:{% endtrans %}</strong></p> |
|||
<table class="contentstable" align="center"><tr> |
|||
<td width="50%"> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("bugs") }}">Reporting bugs</a></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("about") }}">About the documentation</a></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("bugs") }}">{% trans %}Reporting bugs{% endtrans %}</a></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("about") }}">{% trans %}About the documentation{% endtrans %}</a></p> |
|||
</td><td width="50%"> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("license") }}">History and License of Python</a></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("copyright") }}">Copyright</a></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("license") }}">{% trans %}History and License of Python{% endtrans %}</a></p> |
|||
<p class="biglink"><a class="biglink" href="{{ pathto("copyright") }}">{% trans %}Copyright{% endtrans %}</a></p> |
|||
</td></tr> |
|||
</table> |
|||
{% endblock %} |
|||
@ -1,17 +1,17 @@ |
|||
<h3>Download</h3> |
|||
<p><a href="{{ pathto('download') }}">Download these documents</a></p> |
|||
<h3>Docs for other versions</h3> |
|||
<h3>{% trans %}Download{% endtrans %}</h3> |
|||
<p><a href="{{ pathto('download') }}">{% trans %}Download these documents{% endtrans %}</a></p> |
|||
<h3>{% trans %}Docs for other versions{% endtrans %}</h3> |
|||
<ul> |
|||
<li><a href="https://docs.python.org/2.7/">Python 2.7 (stable)</a></li> |
|||
<li><a href="https://docs.python.org/3.4/">Python 3.4 (stable)</a></li> |
|||
<li><a href="https://www.python.org/doc/versions/">Old versions</a></li> |
|||
<li><a href="https://docs.python.org/2.7/">{% trans %}Python 2.7 (stable){% endtrans %}</a></li> |
|||
<li><a href="https://docs.python.org/3.4/">{% trans %}Python 3.4 (stable){% endtrans %}</a></li> |
|||
<li><a href="https://www.python.org/doc/versions/">{% trans %}Old versions{% endtrans %}</a></li> |
|||
</ul> |
|||
|
|||
<h3>Other resources</h3> |
|||
<h3>{% trans %}Other resources{% endtrans %}</h3> |
|||
<ul> |
|||
{# XXX: many of these should probably be merged in the main docs #} |
|||
<li><a href="https://www.python.org/dev/peps/">PEP Index</a></li> |
|||
<li><a href="https://wiki.python.org/moin/BeginnersGuide">Beginner's Guide</a></li> |
|||
<li><a href="https://wiki.python.org/moin/PythonBooks">Book List</a></li> |
|||
<li><a href="https://www.python.org/doc/av/">Audio/Visual Talks</a></li> |
|||
<li><a href="https://www.python.org/dev/peps/">{% trans %}PEP Index{% endtrans %}</a></li> |
|||
<li><a href="https://wiki.python.org/moin/BeginnersGuide">{% trans %}Beginner's Guide{% endtrans %}</a></li> |
|||
<li><a href="https://wiki.python.org/moin/PythonBooks">{% trans %}Book List{% endtrans %}</a></li> |
|||
<li><a href="https://www.python.org/doc/av/">{% trans %}Audio/Visual Talks{% endtrans %}</a></li> |
|||
</ul> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue