cpython: 72edb81e456b (original) (raw)

Mercurial > cpython

changeset 100055:72edb81e456b 2.7

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 Sat, 23 Jan 2016 12:55:11 +0100
parents 63183596db79
children 18c5c68b6075
files Doc/tools/templates/download.html Doc/tools/templates/indexcontent.html Doc/tools/templates/indexsidebar.html Doc/tools/templates/layout.html
diffstat 4 files changed, 134 insertions(+), 93 deletions(-)[+] [-] Doc/tools/templates/download.html 109 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/download.html +++ b/Doc/tools/templates/download.html @@ -7,55 +7,96 @@ {% endif %} {% block body %} -

Download Python {{ release }} Documentation

- -{% if last_updated %}

Last updated on: {{ last_updated }}.

{% endif %} +

{% trans %}Download Python {{ release }} Documentation{% endtrans %}

-

To download an archive containing all the documents for this version of -Python in one of various formats, follow one of links in this table. The numbers -in the table are the size of the download files in megabytes.

+{% if last_updated %}

[](#l1.44) - PDF (A4 paper size)[](#l1.45) - Download (ca. 8 MB)[](#l1.46) - Download (ca. 8 MB)[](#l1.47) + {% trans %}PDF (A4 paper size){% endtrans %}[](#l1.48) + [](#l1.49) + [](#l1.50) + {% trans %}Download{% endtrans %}[](#l1.51) + {% trans %}(ca. 8 MB){% endtrans %}[](#l1.52) + [](#l1.53) + [](#l1.54) + {% trans %}Download{% endtrans %}[](#l1.55) + {% trans %}(ca. 8 MB){% endtrans %}[](#l1.56) [](#l1.57) - HTML[](#l1.58) - Download (ca. 6 MB)[](#l1.59) - Download (ca. 4 MB)[](#l1.60) + {% trans %}HTML{% endtrans %}[](#l1.61) + [](#l1.62) + [](#l1.63) + {% trans %}Download{% endtrans %}[](#l1.64) + {% trans %}(ca. 6 MB){% endtrans %}[](#l1.65) + [](#l1.66) + [](#l1.67) + [](#l1.68) + {% trans %}Download{% endtrans %}[](#l1.69) + {% trans %}(ca. 4 MB){% endtrans %}[](#l1.70) + [](#l1.71) [](#l1.72) - Plain Text[](#l1.73) - Download (ca. 2 MB)[](#l1.74) - Download (ca. 1.5 MB)[](#l1.75) + [](#l1.76) + {% trans %}Plain Text{% endtrans %}[](#l1.77) + [](#l1.78) + [](#l1.79) + {% trans %}Download{% endtrans %}[](#l1.80) + {% trans %}(ca. 2 MB){% endtrans %}[](#l1.81) + [](#l1.82) + [](#l1.83) + [](#l1.84) + {% trans %}Download{% endtrans %}[](#l1.85) + {% trans %}(ca. 1.5 MB){% endtrans %}[](#l1.86) + [](#l1.87) [](#l1.88) [](#l1.89) [](#l1.90) -

These archives contain all the content in the documentation.

[](#l1.91) +

{% trans %}These archives contain all the content in the[](#l1.92) +documentation.{% endtrans %}

[](#l1.93) [](#l1.94) -

HTML Help (.chm) files are made available in the "Windows" section[](#l1.95) -on the Python[](#l1.96) -download page.

[](#l1.97) +

{% trans download_page="https://www.python.org/download/releases/{{ release[:5] }}/" %}HTML Help[](#l1.98) +(.chm) files are made available in the "Windows" section[](#l1.99) +on the Python download page.{% endtrans %}

[](#l1.100) [](#l1.101) [](#l1.102) -

Unpacking

[](#l1.103) +

{% trans %}Unpacking{% endtrans %}

[](#l1.104) [](#l1.105) -

Unix users should download the .tar.bz2 archives; these are bzipped tar[](#l1.106) -archives and can be handled in the usual way using tar and the bzip2[](#l1.107) -program. The InfoZIP unzip program can be[](#l1.108) -used to handle the ZIP archives if desired. The .tar.bz2 archives provide the[](#l1.109) -best compression and fastest download times.

[](#l1.110) +

{% trans %}Unix users should download the .tar.bz2 archives; these[](#l1.111) +are bzipped tar archives and can be handled in the usual way using tar[](#l1.112) +and the bzip2 program. The InfoZIP unzip[](#l1.113) +program can be used to handle the ZIP archives if desired. The[](#l1.114) +.tar.bz2 archives provide the best compression and fastest download[](#l1.115) +times.{% endtrans %}

[](#l1.116) [](#l1.117) -

Windows users can use the ZIP archives since those are customary on that[](#l1.118) -platform. These are created on Unix using the InfoZIP zip program.

[](#l1.119) +

{% trans %}Windows users can use the ZIP archives since those are[](#l1.120) +customary on that platform. These are created on Unix using the[](#l1.121) +InfoZIP zip program.{% endtrans %}

[](#l1.122) [](#l1.123) [](#l1.124) -

Problems

[](#l1.125) +

{% trans %}Problems{% endtrans %}

[](#l1.126) [](#l1.127) -

If you have comments or suggestions for the Python documentation, please send[](#l1.128) -email to docs@python.org.

[](#l1.129) +

{% trans %}If you have comments or suggestions for the Python[](#l1.130) +documentation, please send email to[](#l1.131) +docs@python.org.{% endtrans %}

[](#l1.132) {% endblock %}[](#l1.133)

--- a/Doc/tools/templates/indexcontent.html +++ b/Doc/tools/templates/indexcontent.html @@ -1,59 +1,59 @@ {% extends "defindex.html" %} {% block tables %}

--- a/Doc/tools/templates/indexsidebar.html +++ b/Doc/tools/templates/indexsidebar.html @@ -1,17 +1,17 @@ -

Download

-

Download these documents

-

Docs for other versions

+

{% trans %}Download{% endtrans %}

+

{% trans %}Download these documents{% endtrans %}

+

{% trans %}Docs for other versions{% endtrans %}

--- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -6,7 +6,7 @@

  • {%- if versionswitcher is defined %} {{ release }}
  • @@ -28,24 +28,24 @@ {% endblock %} {% block footer %}

    [](#l4.31) {% endblock %}[](#l4.32) {% block sidebarsourcelink %}[](#l4.33) {%- if show_source and has_source and sourcename %}[](#l4.34)

    {{ _('This Page') }}

    [](#l4.35) [](#l4.42) {%- endif %}[](#l4.43) {% endblock %}[](#l4.44)