diff options
author | Julien <github@mandark.fr> | 2017-08-07 08:27:21 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-08-07 08:27:21 (GMT) |
commit | dff9b5f9d62aa0b23f8a255867d09d11890efd1b (patch) | |
tree | 955eae19be5ae1104c112611f69e8755e708c9b7 /Doc/tools/templates | |
parent | 60a6632a3d2b2dde1c01850f0aa36a22c8dec8dd (diff) | |
download | cpython-dff9b5f9d62aa0b23f8a255867d09d11890efd1b.zip cpython-dff9b5f9d62aa0b23f8a255867d09d11890efd1b.tar.gz cpython-dff9b5f9d62aa0b23f8a255867d09d11890efd1b.tar.bz2 |
bpo-31045: Language switch (#2652)
* Doc: Indicate the language
* Renaming version_switcher to switchers (to add language_switcher).
* Adding language switch.
* Doc switchers: Enhance readability of regex parsing versions.
* Doc switchers: Desambiguate the need of a replace(/\/+$/g, '') by proper naming.
* Doc switchers: py3k can't reach js, it's redirected server-side by nginx.
* Doc switchers: Examples matching actual regexes.
* Doc switchers: Better fallback on unexisting translated version.
Diffstat (limited to 'Doc/tools/templates')
-rw-r--r-- | Doc/tools/templates/layout.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index 640d8b3..c210667 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -4,7 +4,8 @@ style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a>{{ reldelim1 }}</li> <li> - {%- if versionswitcher is defined %} + {%- if switchers is defined %} + <span class="language_switcher_placeholder">{{ language or 'en' }}</span> <span class="version_switcher_placeholder">{{ release }}</span> <a href="{{ pathto('index') }}">{% trans %}Documentation {% endtrans %}</a>{{ reldelim1 }} {%- else %} @@ -41,7 +42,7 @@ <link rel="canonical" href="https://docs.python.org/3/{{pagename}}.html" /> {% if builder != "htmlhelp" %} {% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %} - {% if versionswitcher is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/version_switch.js', 1) }}"></script>{% endif %} + {% if switchers is defined and not embedded %}<script type="text/javascript" src="{{ pathto('_static/switchers.js', 1) }}"></script>{% endif %} {% if pagename == 'whatsnew/changelog' and not embedded %} <script type="text/javascript"> $(document).ready(function() { |