cpython: b1615165fa4a (original) (raw)
Mercurial > cpython
changeset 100046:b1615165fa4a 3.5
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. [#25907]
Victor Stinner victor.stinner@gmail.com | |
---|---|
date | Fri, 22 Jan 2016 18:00:05 +0100 |
parents | 8e0a736b82ff |
children | 5af5b36c197e e86515294283 |
files | Doc/tools/templates/indexcontent.html Doc/tools/templates/indexsidebar.html Doc/tools/templates/layout.html |
diffstat | 3 files changed, 59 insertions(+), 59 deletions(-)[+] [-] Doc/tools/templates/indexcontent.html 78 Doc/tools/templates/indexsidebar.html 22 Doc/tools/templates/layout.html 18 |
line wrap: on
line diff
--- a/Doc/tools/templates/indexcontent.html +++ b/Doc/tools/templates/indexcontent.html @@ -1,59 +1,59 @@ {% extends "defindex.html" %} {% block tables %}
Parts of the documentation:
[](#l1.6)
{% trans %}Parts of the documentation:{% endtrans %}
[](#l1.7)[](#l1.8) [](#l1.9)
<p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">What's new in Python {{ version }}?</a><br/>[](#l1.10)
<span class="linkdescr">or <a href="{{ pathto("whatsnew/index") }}">all "What's new" documents</a> since 2.0</span></p>[](#l1.11)
<p class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">Tutorial</a><br/>[](#l1.12)
<span class="linkdescr">start here</span></p>[](#l1.13)
<p class="biglink"><a class="biglink" href="{{ pathto("library/index") }}">Library Reference</a><br/>[](#l1.14)
<span class="linkdescr">keep this under your pillow</span></p>[](#l1.15)
<p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">Language Reference</a><br/>[](#l1.16)
<span class="linkdescr">describes syntax and language elements</span></p>[](#l1.17)
<p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup and Usage</a><br/>[](#l1.18)
<span class="linkdescr">how to use Python on different platforms</span></p>[](#l1.19)
<p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTOs</a><br/>[](#l1.20)
<span class="linkdescr">in-depth documents on specific topics</span></p>[](#l1.21)
<p class="biglink"><a class="biglink" href="{{ pathto("whatsnew/" + version) }}">{% trans %}What's new in Python {{ version }}?{% endtrans %}</a><br/>[](#l1.22)
<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>[](#l1.23)
<p class="biglink"><a class="biglink" href="{{ pathto("tutorial/index") }}">{% trans %}Tutorial{% endtrans %}</a><br/>[](#l1.24)
<span class="linkdescr">{% trans %}start here{% endtrans %}</span></p>[](#l1.25)
<p class="biglink"><a class="biglink" href="{{ pathto("library/index") }}">{% trans %}Library Reference{% endtrans %}</a><br/>[](#l1.26)
<span class="linkdescr">{% trans %}keep this under your pillow{% endtrans %}</span></p>[](#l1.27)
<p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">{% trans %}Language Reference{% endtrans %}</a><br/>[](#l1.28)
<span class="linkdescr">{% trans %}describes syntax and language elements{% endtrans %}</span></p>[](#l1.29)
<p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">{% trans %}Python Setup and Usage{% endtrans %}</a><br/>[](#l1.30)
<span class="linkdescr">{% trans %}how to use Python on different platforms{% endtrans %}</span></p>[](#l1.31)
<p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">{% trans %}Python HOWTOs{% endtrans %}</a><br/>[](#l1.32)
<span class="linkdescr">{% trans %}in-depth documents on specific topics{% endtrans %}</span></p>[](#l1.33)
[](#l1.34)
<p class="biglink"><a class="biglink" href="{{ pathto("installing/index") }}">Installing Python Modules</a><br/>[](#l1.35)
<span class="linkdescr">installing from the Python Package Index & other sources</span></p>[](#l1.36)
<p class="biglink"><a class="biglink" href="{{ pathto("distributing/index") }}">Distributing Python Modules</a><br/>[](#l1.37)
<span class="linkdescr">publishing modules for installation by others</span></p>[](#l1.38)
<p class="biglink"><a class="biglink" href="{{ pathto("extending/index") }}">Extending and Embedding</a><br/>[](#l1.39)
<span class="linkdescr">tutorial for C/C++ programmers</span></p>[](#l1.40)
<p class="biglink"><a class="biglink" href="{{ pathto("c-api/index") }}">Python/C API</a><br/>[](#l1.41)
<span class="linkdescr">reference for C/C++ programmers</span></p>[](#l1.42)
<p class="biglink"><a class="biglink" href="{{ pathto("faq/index") }}">FAQs</a><br/>[](#l1.43)
<span class="linkdescr">frequently asked questions (with answers!)</span></p>[](#l1.44)
<p class="biglink"><a class="biglink" href="{{ pathto("installing/index") }}">{% trans %}Installing Python Modules{% endtrans %}</a><br/>[](#l1.45)
<span class="linkdescr">{% trans %}installing from the Python Package Index & other sources{% endtrans %}</span></p>[](#l1.46)
<p class="biglink"><a class="biglink" href="{{ pathto("distributing/index") }}">{% trans %}Distributing Python Modules{% endtrans %}</a><br/>[](#l1.47)
<span class="linkdescr">{% trans %}publishing modules for installation by others{% endtrans %}</span></p>[](#l1.48)
<p class="biglink"><a class="biglink" href="{{ pathto("extending/index") }}">{% trans %}Extending and Embedding{% endtrans %}</a><br/>[](#l1.49)
<span class="linkdescr">{% trans %}tutorial for C/C++ programmers{% endtrans %}</span></p>[](#l1.50)
<p class="biglink"><a class="biglink" href="{{ pathto("c-api/index") }}">{% trans %}Python/C API{% endtrans %}</a><br/>[](#l1.51)
<span class="linkdescr">{% trans %}reference for C/C++ programmers{% endtrans %}</span></p>[](#l1.52)
<p class="biglink"><a class="biglink" href="{{ pathto("faq/index") }}">{% trans %}FAQs{% endtrans %}</a><br/>[](#l1.53)
[](#l1.55) [](#l1.56) [](#l1.57)<span class="linkdescr">{% trans %}frequently asked questions (with answers!){% endtrans %}</span></p>[](#l1.54)
Indices and tables:
[](#l1.58)
{% trans %}Indices and tables:{% endtrans %}
[](#l1.59)[](#l1.60) [](#l1.61)
<p class="biglink"><a class="biglink" href="{{ pathto("py-modindex") }}">Global Module Index</a><br/>[](#l1.62)
<span class="linkdescr">quick access to all modules</span></p>[](#l1.63)
<p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">General Index</a><br/>[](#l1.64)
<span class="linkdescr">all functions, classes, terms</span></p>[](#l1.65)
<p class="biglink"><a class="biglink" href="{{ pathto("glossary") }}">Glossary</a><br/>[](#l1.66)
<span class="linkdescr">the most important terms explained</span></p>[](#l1.67)
<p class="biglink"><a class="biglink" href="{{ pathto("py-modindex") }}">{% trans %}Global Module Index{% endtrans %}</a><br/>[](#l1.68)
<span class="linkdescr">{% trans %}quick access to all modules{% endtrans %}</span></p>[](#l1.69)
<p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">{% trans %}General Index{% endtrans %}</a><br/>[](#l1.70)
<span class="linkdescr">{% trans %}all functions, classes, terms{% endtrans %}</span></p>[](#l1.71)
<p class="biglink"><a class="biglink" href="{{ pathto("glossary") }}">{% trans %}Glossary{% endtrans %}</a><br/>[](#l1.72)
<span class="linkdescr">{% trans %}the most important terms explained{% endtrans %}</span></p>[](#l1.73)
[](#l1.74)
<p class="biglink"><a class="biglink" href="{{ pathto("search") }}">Search page</a><br/>[](#l1.75)
<span class="linkdescr">search this documentation</span></p>[](#l1.76)
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Complete Table of Contents</a><br/>[](#l1.77)
<span class="linkdescr">lists all sections and subsections</span></p>[](#l1.78)
<p class="biglink"><a class="biglink" href="{{ pathto("search") }}">{% trans %}Search page{% endtrans %}</a><br/>[](#l1.79)
<span class="linkdescr">{% trans %}search this documentation{% endtrans %}</span></p>[](#l1.80)
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">{% trans %}Complete Table of Contents{% endtrans %}</a><br/>[](#l1.81)
[](#l1.83) [](#l1.84) [](#l1.85)<span class="linkdescr">{% trans %}lists all sections and subsections{% endtrans %}</span></p>[](#l1.82)
Meta information:
[](#l1.86)
{% trans %}Meta information:{% endtrans %}
[](#l1.87)[](#l1.88) [](#l1.89)
<p class="biglink"><a class="biglink" href="{{ pathto("bugs") }}">Reporting bugs</a></p>[](#l1.90)
<p class="biglink"><a class="biglink" href="{{ pathto("about") }}">About the documentation</a></p>[](#l1.91)
<p class="biglink"><a class="biglink" href="{{ pathto("bugs") }}">{% trans %}Reporting bugs{% endtrans %}</a></p>[](#l1.92)
<p class="biglink"><a class="biglink" href="{{ pathto("about") }}">{% trans %}About the documentation{% endtrans %}</a></p>[](#l1.93)
[](#l1.94)
<p class="biglink"><a class="biglink" href="{{ pathto("license") }}">History and License of Python</a></p>[](#l1.95)
<p class="biglink"><a class="biglink" href="{{ pathto("copyright") }}">Copyright</a></p>[](#l1.96)
<p class="biglink"><a class="biglink" href="{{ pathto("license") }}">{% trans %}History and License of Python{% endtrans %}</a></p>[](#l1.97)
[](#l1.99) [](#l1.100) {% endblock %}[](#l1.101)<p class="biglink"><a class="biglink" href="{{ pathto("copyright") }}">{% trans %}Copyright{% endtrans %}</a></p>[](#l1.98)
--- a/Doc/tools/templates/indexsidebar.html +++ b/Doc/tools/templates/indexsidebar.html @@ -1,17 +1,17 @@ -
Download
- -Docs for other versions
+{% trans %}Download{% endtrans %}
+{% trans %}Download these documents{% endtrans %}
+{% trans %}Docs for other versions{% endtrans %}
- Python 2.7 (stable) [](#l2.11)
- Python 3.4 (stable) [](#l2.12)
- Old versions [](#l2.13)
- {% trans %}Python 2.7 (stable){% endtrans %} [](#l2.14)
- {% trans %}Python 3.4 (stable){% endtrans %} [](#l2.15)
- {% trans %}Old versions{% endtrans %} [](#l2.16)
- PEP Index [](#l2.23)
- Beginner's Guide [](#l2.24)
- Book List [](#l2.25)
- Audio/Visual Talks [](#l2.26)
- {% trans %}PEP Index{% endtrans %} [](#l2.27)
- {% trans %}Beginner's Guide{% endtrans %} [](#l2.28)
- {% trans %}Book List{% endtrans %} [](#l2.29)
- {% trans %}Audio/Visual Talks{% endtrans %} [](#l2.30)
Other resources
[](#l2.19) +{% trans %}Other resources{% endtrans %}
[](#l2.20)- [](#l2.21)
{# XXX: many of these should probably be merged in the main docs #}[](#l2.22)
--- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -6,7 +6,7 @@
<a href="{{ pathto('index') }}">Documentation</a>{{ reldelim1 }}[](#l3.7)
<a href="{{ pathto('index') }}">{% trans %}Documentation {% endtrans %}</a>{{ reldelim1 }}[](#l3.8) {%- else %}[](#l3.9) <a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}[](#l3.10) {%- endif %}[](#l3.11)
@@ -79,24 +79,24 @@ {% endblock %} {% block footer %}
- © Copyright {{ copyright|e }}.
- © {% trans %}Copyright{% endtrans %} {{ copyright|e }}.
- The Python Software Foundation is a non-profit corporation.
- Please donate.
- {% trans %}The Python Software Foundation is a non-profit corporation.{% endtrans %}
- {% trans %}Please donate.{% endtrans %}
- Last updated on {{ last_updated|e }}.
- Found a bug?
- {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
- {% trans pathto_bugs=pathto('bugs') %}Found a bug?{% endtrans %}
- Created using Sphinx {{ sphinx_version|e }}.
- {% trans sphinx_version=sphinx_version|e %}Created using Sphinx {{ sphinx_version }}.{% endtrans %}
{{ _('This Page') }}
[](#l3.35)- [](#l3.36)
- Report a Bug [](#l3.37)
- {% trans %}Report a Bug{% endtrans %} [](#l3.38)
rel="nofollow">Show Source</a></li>[](#l3.40)
rel="nofollow">{% trans %}Show Source{% endtrans %}</a></li>[](#l3.41)