Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made the docs application/templates translatable

  • Loading branch information...
commit faf676703cbcc50f95cb03989b6978c519988e52 1 parent 4859776
Claude Paroz claudep authored
1  .gitignore
View
@@ -4,3 +4,4 @@ local_settings.py
djangodocs
static_root
djangodocs.index
+docs/locale/*/LC_MESSAGES/django.mo
2  django_docs/settings.py
View
@@ -44,6 +44,8 @@
SITE_ID = 2
+USE_I18N = True
+LANGUAGE_CODE = 'en'
### Docs settings
187 docs/locale/en/LC_MESSAGES/django.po
View
@@ -0,0 +1,187 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-06-13 14:10+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: templates/docs/doc.html:4 templates/docs/doc.html.py:13
+msgid "Django documentation"
+msgstr ""
+
+#: templates/docs/doc.html:34
+msgid ""
+"This document is for Django's development version, which can be "
+"significantly different from previous releases."
+msgstr ""
+
+#: templates/docs/doc.html:34
+#, python-format
+msgid "This document describes Django %(version)s."
+msgstr ""
+
+#: templates/docs/doc.html:34
+msgid "Click on the links on the left to see other versions."
+msgstr ""
+
+#: templates/docs/doc.html:35
+msgid "Documentation version:"
+msgstr ""
+
+#: templates/docs/doc.html:51
+msgid "Questions/Feedback"
+msgstr ""
+
+#: templates/docs/doc.html:52
+msgid "Having trouble? We'd like to help!"
+msgstr ""
+
+#: templates/docs/doc.html:56
+#, python-format
+msgid ""
+"Try the <a href=\"%(faq_url)s\">FAQ</a> — it's got answers to many common "
+"questions."
+msgstr ""
+
+#: templates/docs/doc.html:59
+msgid ""
+"Search for information in the <a\n"
+" href=\"http://groups.google.com/group/django-users/\">archives of the\n"
+" django-users mailing list</a>, or <a\n"
+" href=\"http://groups.google.com/group/django-users/\">post a question</"
+"a>."
+msgstr ""
+
+#: templates/docs/doc.html:65
+msgid ""
+"Ask a question in the <a href=\"irc://irc.freenode.net/\">#django IRC\n"
+" channel</a>, or search the <a href=\"http://django-irc-logs.com/"
+"\">IRC\n"
+" logs</a> to see if it has been asked before."
+msgstr ""
+
+#: templates/docs/doc.html:70
+msgid ""
+"If you notice errors with this documentation, please <a\n"
+" href=\"https://code.djangoproject.com/newticket?component=Documentation"
+"\">\n"
+" open a ticket</a> and let us know! Please only use the ticket tracker "
+"for\n"
+" criticisms and improvements on the docs. For tech support, use the\n"
+" resources above."
+msgstr ""
+
+#: templates/docs/doc.html:82 templates/docs/search.html:19
+#: templates/docs/search_form.html:13
+msgid "Search"
+msgstr ""
+
+#: templates/docs/doc.html:88
+msgid "Contents"
+msgstr ""
+
+#: templates/docs/doc.html:94
+msgid "Browse"
+msgstr ""
+
+#: templates/docs/doc.html:98
+msgid "Prev:"
+msgstr ""
+
+#: templates/docs/doc.html:101
+msgid "Next:"
+msgstr ""
+
+#: templates/docs/doc.html:103
+msgid "Table of contents"
+msgstr ""
+
+#: templates/docs/doc.html:112
+msgid "You are here:"
+msgstr ""
+
+#: templates/docs/doc.html:116
+#, python-format
+msgid "Django %(version)s documentation"
+msgstr ""
+
+#: templates/docs/doc.html:127
+msgid "Download:"
+msgstr ""
+
+#: templates/docs/doc.html:129
+msgid "Offline (development version):"
+msgstr ""
+
+#: templates/docs/doc.html:130
+#, python-format
+msgid "Offline (Django %(version)s):"
+msgstr ""
+
+#: templates/docs/doc.html:136
+msgid "Provided by <a href=\"http://readthedocs.org/\">Read the Docs</a>."
+msgstr ""
+
+#: templates/docs/genindex.html:4
+msgid "General Index | Django Documentation"
+msgstr ""
+
+#: templates/docs/genindex.html:6 templates/docs/genindex.html.py:9
+msgid "General Index"
+msgstr ""
+
+#: templates/docs/genindex.html:39
+msgid "[Link]"
+msgstr ""
+
+#: templates/docs/py-modindex.html:4
+msgid "Module Index | Django Documentation"
+msgstr ""
+
+#: templates/docs/py-modindex.html:6 templates/docs/py-modindex.html.py:9
+msgid "Module Index"
+msgstr ""
+
+#: templates/docs/search.html:6
+msgid "Search | Django documentation"
+msgstr ""
+
+#: templates/docs/search.html:15
+msgid "Search for:"
+msgstr ""
+
+#: templates/docs/search.html:17
+msgid "in version:"
+msgstr ""
+
+#: templates/docs/search.html:26
+msgid "Results"
+msgstr ""
+
+#: templates/docs/search.html:34
+msgid "No results found."
+msgstr ""
+
+#: templates/docs/search.html:43
+msgid "Previous"
+msgstr ""
+
+#: templates/docs/search.html:49
+msgid "Next"
+msgstr ""
+
+#: templates/docs/search_form.html:9
+msgid "Version:"
+msgstr ""
204 docs/locale/fr/LC_MESSAGES/django.po
View
@@ -0,0 +1,204 @@
+# French translation of djangoproject.com docs app.
+# Copyright (C) 2013, the Django Software Foundation
+# This file is distributed under the same license as the djangoproject.com package.
+# Claude Paroz <claude@2xlibre.net, 2013
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: djangoproject.com docs\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-06-13 14:11+0200\n"
+"PO-Revision-Date: 2013-06-13 14:31+0200\n"
+"Last-Translator: Claude Paroz <claude@2xlibre.net>\n"
+"Language-Team: French <fr@li.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: templates/docs/doc.html:4 templates/docs/doc.html.py:13
+msgid "Django documentation"
+msgstr "Documentation de Django"
+
+#: templates/docs/doc.html:34
+msgid ""
+"This document is for Django's development version, which can be "
+"significantly different from previous releases."
+msgstr ""
+"Ce document concerne la version de développement de Django, qui "
+"peut différer significativement des versions précédentes."
+
+#: templates/docs/doc.html:34
+#, python-format
+msgid "This document describes Django %(version)s."
+msgstr "Ce document présente la version %(version)s de Django."
+
+#: templates/docs/doc.html:34
+msgid "Click on the links on the left to see other versions."
+msgstr "Cliquez sur les liens à gauche pour voir d'autres versions."
+
+#: templates/docs/doc.html:35
+msgid "Documentation version:"
+msgstr "Version de la documentation :"
+
+#: templates/docs/doc.html:51
+msgid "Questions/Feedback"
+msgstr "Questions/avis"
+
+#: templates/docs/doc.html:52
+msgid "Having trouble? We'd like to help!"
+msgstr "Des problèmes ? Nous voulons vous aider !"
+
+#: templates/docs/doc.html:56
+#, python-format
+msgid ""
+"Try the <a href=\"%(faq_url)s\">FAQ</a> — it's got answers to many common "
+"questions."
+msgstr ""
+"Consultez la <a href=\"%(faq_url)s\">FAQ</a>, elle contient des réponses "
+"à de nombreuses questions."
+
+#: templates/docs/doc.html:59
+msgid ""
+"Search for information in the <a\n"
+" href=\"http://groups.google.com/group/django-users/\">archives of the\n"
+" django-users mailing list</a>, or <a\n"
+" href=\"http://groups.google.com/group/django-users/\">post a question</"
+"a>."
+msgstr ""
+"Recherchez des informations (en anglais) dans les <a href=\"http://"
+"groups.google.com/group/django-users/\">archives de la liste de diffusion "
+"django-users</a> ou <a href=\"http://groups.google.com/group/django-users/\""
+">écrivez votre question</a>."
+
+#: templates/docs/doc.html:65
+msgid ""
+"Ask a question in the <a href=\"irc://irc.freenode.net/\">#django IRC\n"
+" channel</a>, or search the <a href=\"http://django-irc-logs.com/"
+"\">IRC\n"
+" logs</a> to see if it has been asked before."
+msgstr ""
+"Posez une question dans le <a href=\"irc://irc.freenode.net/\"> canal "
+"IRC #django-fr</a> ou recherchez (en anglais) dans les <a href=\""
+"http://django-irc-logs.com/\">journaux IRC du canal #django</a> pour "
+"savoir si la question a déjà été posée."
+
+#: templates/docs/doc.html:70
+msgid ""
+"If you notice errors with this documentation, please <a\n"
+" href=\"https://code.djangoproject.com/newticket?component=Documentation"
+"\">\n"
+" open a ticket</a> and let us know! Please only use the ticket tracker "
+"for\n"
+" criticisms and improvements on the docs. For tech support, use the\n"
+" resources above."
+msgstr ""
+"Si vous constatez des erreurs dans cette documentation, veuillez "
+"<a href=\"https://code.djangoproject.com/newticket?component=Documentation\">"
+"ouvrir un ticket</a> (en anglais) pour nous le faire savoir. Le système de "
+"tickets n'est destiné qu'aux corrections et améliorations de la documentation. "
+"Pour du support technique, utilisez les ressources ci-dessus."
+
+#: templates/docs/doc.html:82 templates/docs/search.html:19
+#: templates/docs/search_form.html:13
+msgid "Search"
+msgstr "Rechercher"
+
+#: templates/docs/doc.html:88
+msgid "Contents"
+msgstr "Sommaire"
+
+#: templates/docs/doc.html:94
+msgid "Browse"
+msgstr "Parcourir"
+
+#: templates/docs/doc.html:98
+msgid "Prev:"
+msgstr "Précédent :"
+
+#: templates/docs/doc.html:101
+msgid "Next:"
+msgstr "Suivant :"
+
+#: templates/docs/doc.html:103
+msgid "Table of contents"
+msgstr "Table des matières"
+
+#: templates/docs/doc.html:112
+msgid "You are here:"
+msgstr "Vous êtes ici :"
+
+#: templates/docs/doc.html:116
+#, python-format
+msgid "Django %(version)s documentation"
+msgstr "Documentation de Django %(version)s"
+
+#: templates/docs/doc.html:127
+msgid "Download:"
+msgstr "Télécharger :"
+
+#: templates/docs/doc.html:129
+msgid "Offline (development version):"
+msgstr "Hors ligne (version de développement) :"
+
+#: templates/docs/doc.html:130
+#, python-format
+msgid "Offline (Django %(version)s):"
+msgstr "Hors ligne (Django %(version)s) :"
+
+#: templates/docs/doc.html:136
+msgid "Provided by <a href=\"http://readthedocs.org/\">Read the Docs</a>."
+msgstr "Offert par <a href=\"http://readthedocs.org/\">Read the Docs</a>."
+
+#: templates/docs/genindex.html:4
+msgid "General Index | Django Documentation"
+msgstr "Index général | Documentation de Django"
+
+#: templates/docs/genindex.html:6 templates/docs/genindex.html.py:9
+msgid "General Index"
+msgstr "Index général"
+
+#: templates/docs/genindex.html:39
+msgid "[Link]"
+msgstr "[Lien]"
+
+#: templates/docs/py-modindex.html:4
+msgid "Module Index | Django Documentation"
+msgstr "Index des modules | Documentation de Django"
+
+#: templates/docs/py-modindex.html:6 templates/docs/py-modindex.html.py:9
+msgid "Module Index"
+msgstr "Index des modules"
+
+#: templates/docs/search.html:6
+msgid "Search | Django documentation"
+msgstr "Recherche | Documentation de Django"
+
+#: templates/docs/search.html:15
+msgid "Search for:"
+msgstr "Rechercher :"
+
+#: templates/docs/search.html:17
+msgid "in version:"
+msgstr "dans la version :"
+
+#: templates/docs/search.html:26
+msgid "Results"
+msgstr "Résultats"
+
+#: templates/docs/search.html:34
+msgid "No results found."
+msgstr "Aucun résultat."
+
+#: templates/docs/search.html:43
+msgid "Previous"
+msgstr "Précédent"
+
+#: templates/docs/search.html:49
+msgid "Next"
+msgstr "Suivant"
+
+#: templates/docs/search_form.html:9
+msgid "Version:"
+msgstr "Version :"
2  docs/search_indexes.py
View
@@ -1,4 +1,4 @@
-# -*- coding: utf-8-*-
+# -*- coding: utf-8 -*-
import json
from django.utils.html import strip_tags
54 docs/templates/docs/doc.html
View
@@ -1,6 +1,7 @@
{% extends "base_docs.html" %}
+{% load i18n %}
-{% block title %}{{ doc.title|striptags|safe }} | Django documentation{% endblock %}
+{% block title %}{{ doc.title|striptags|safe }} | {% trans "Django documentation" %}{% endblock %}
{% block extrahead %}
{{ block.super }}
@@ -9,7 +10,7 @@
{% endblock %}
{% block billboard %}
- <h2><a href="{% url 'document-index' lang=lang version=version %}">Django documentation</a></h2>
+ <h2><a href="{% url 'document-index' lang=lang version=version %}">{% trans "Django documentation" %}</a></h2>
{% endblock %}
{% block content %}
@@ -30,8 +31,8 @@
{% endif %}
{% endfor %}
<li class="current"
- title="{% if version == 'dev' %}This document is for Django's development version, which can be significantly different from previous releases.{% else %}This document describes Django {{ version }}.{% endif %} Click on the links on the left to see other versions.">
- <span>Documentation version:
+ title="{% if version == 'dev' %}{% trans "This document is for Django's development version, which can be significantly different from previous releases." %}{% else %}{% blocktrans %}This document describes Django {{ version }}.{% endblocktrans %}{% endif %} {% trans "Click on the links on the left to see other versions." %}">
+ <span>{% trans "Documentation version:" %}
<strong>{{ version }}</strong>
</span>
</li>
@@ -47,30 +48,30 @@
{% endif %}
</div>
<div id="content-secondary">
- <h2 id="comments">Questions/Feedback</h2>
- <p>Having trouble? We'd like to help!</p>
+ <h2 id="comments">{% trans "Questions/Feedback" %}</h2>
+ <p>{% trans "Having trouble? We'd like to help!" %}</p>
<ul>
<li>
- Try the <a href="{% url 'document-detail' lang=lang version=version url="faq" %}">FAQ</a>
- — it's got answers to many common questions.
+ {% url 'document-detail' lang=lang version=version url="faq" as faq_url %}
+ {% blocktrans %}Try the <a href="{{ faq_url }}">FAQ</a> — it's got answers to many common questions.{% endblocktrans %}
</li>
<li>
- Search for information in the <a
+ {% blocktrans %}Search for information in the <a
href="http://groups.google.com/group/django-users/">archives of the
django-users mailing list</a>, or <a
- href="http://groups.google.com/group/django-users/">post a question</a>.
+ href="http://groups.google.com/group/django-users/">post a question</a>.{% endblocktrans %}
</li>
<li>
- Ask a question in the <a href="irc://irc.freenode.net/">#django IRC
+ {% blocktrans %}Ask a question in the <a href="irc://irc.freenode.net/">#django IRC
channel</a>, or search the <a href="http://django-irc-logs.com/">IRC
- logs</a> to see if it has been asked before.
+ logs</a> to see if it has been asked before.{% endblocktrans %}
</li>
<li>
- If you notice errors with this documentation, please <a
+ {% blocktrans %}If you notice errors with this documentation, please <a
href="https://code.djangoproject.com/newticket?component=Documentation">
open a ticket</a> and let us know! Please only use the ticket tracker for
criticisms and improvements on the docs. For tech support, use the
- resources above.
+ resources above.{% endblocktrans %}
</li>
</ul>
</div>
@@ -78,28 +79,28 @@ <h2 id="comments">Questions/Feedback</h2>
{% block content-related %}
{% block search %}
- <h2>Search</h2>
+ <h2>{% trans "Search" %}</h2>
{% load docs %}
{% search_form %}
{% endblock %}
{% block toc-wrapper %}
- <h2>Contents</h2>
+ <h2>{% trans "Contents" %}</h2>
{% block toc %}
{{ doc.toc|safe }}
{% endblock %}
{% endblock %}
{% block browse-wrapper %}
- <h2>Browse</h2>
+ <h2>{% trans "Browse" %}</h2>
<ul>
{% block browse %}
{% if doc.prev %}
- <li>Prev: <a href="{{ doc.prev.link }}">{{ doc.prev.title|safe }}</a></li>
+ <li>{% trans "Prev:" %} <a href="{{ doc.prev.link }}">{{ doc.prev.title|safe }}</a></li>
{% endif %}
{% if doc.next %}
- <li>Next: <a href="{{ doc.next.link }}">{{ doc.next.title|safe }}</a></li>
+ <li>{% trans "Next:" %} <a href="{{ doc.next.link }}">{{ doc.next.title|safe }}</a></li>
{% endif %}
- <li><a href="{% url 'document-detail' lang=lang version=version url="contents" %}">Table of contents</a></li>
+ <li><a href="{% url 'document-detail' lang=lang version=version url="contents" %}">{% trans "Table of contents" %}</a></li>
{% for doc, title, accesskey, shorttitle in env.rellinks %}
<li><a href="{% url 'document-detail' lang=lang version=version url=doc %}">{{ title }}</a></li>
{% endfor %}
@@ -108,11 +109,11 @@ <h2 id="comments">Questions/Feedback</h2>
{% endblock %}
{% block breadcrumbs-wrapper %}
- <h2>You are here:</h2>
+ <h2>{% trans "You are here:" %}</h2>
<ul>
{% block breadcrumbs %}
<li>
- <a href="{% url 'document-index' lang=lang version=version %}">Django {{ version }} documentation</a>
+ <a href="{% url 'document-index' lang=lang version=version %}">{% blocktrans %}Django {{ version }} documentation{% endblocktrans %}</a>
{% for p in doc.parents %}
<ul><li><a href="{{ p.link }}">{{ p.title|safe }}</a>
{% endfor %}
@@ -123,14 +124,17 @@ <h2 id="comments">Questions/Feedback</h2>
</ul>
{% if version != "1.1" and version != "1.0" %}
- <h2>Download:</h2>
+ <h2>{% trans "Download:" %}</h2>
<p>
- Offline ({% if version == "dev" %}development version{% else %}Django {{ version }}{% endif %}):
+ {% if version == "dev" %}{% trans "Offline (development version):" %}
+ {% else %}{% blocktrans %}Offline (Django {{ version }}):{% endblocktrans %}{% endif %}
<a href="{{ STATIC_URL }}docs/django-docs-{{ version }}-{{ lang }}.zip">HTML</a> |
<a href="http://media.readthedocs.org/pdf/django/{{ rtd_version }}/django.pdf">PDF</a> |
<a href="http://media.readthedocs.org/epub/django/{{ rtd_version }}/django.epub">ePub</a>
<br>
- <span class="quiet">Provided by <a href="http://readthedocs.org/">Read the Docs</a>.
+ <span class="quiet">
+ {% blocktrans %}Provided by <a href="http://readthedocs.org/">Read the Docs</a>.{% endblocktrans %}
+ </span>
</p>
{% endif %}
{% endblock %}
9 docs/templates/docs/genindex.html
View
@@ -1,11 +1,12 @@
{% extends "docs/doc.html" %}
+{% load i18n %}
-{% block title %}General Index | Django Documentation{% endblock %}
+{% block title %}{% trans "General Index | Django Documentation" %}{% endblock %}
{% block toc-wrapper %}{% endblock %}
-{% block current-page-title %}General Index{% endblock %}
+{% block current-page-title %}{% trans "General Index" %}{% endblock %}
{% block body %}
- <h1>General Index</h1>
+ <h1>{% trans "General Index" %}</h1>
<p class="indexletters">
{% for letter, _ in doc.genindexentries %}
@@ -35,7 +36,7 @@ <h2 id="{{ letter }}">{{ letter }}</h2>
{% for subname, sublinks in contents.1 %}
<dd>
<a href="{{ sublinks.0.1 }}">{{ subname }}</a>
- {% for link in sublinks|slice:"1:" %}, <a href="{{ link.1 }}">[Link]</a>{% endfor %}
+ {% for link in sublinks|slice:"1:" %}, <a href="{{ link.1 }}">{% trans "[Link]" %}</a>{% endfor %}
</dd>
{% endfor %}
{% endif %}
7 docs/templates/docs/py-modindex.html
View
@@ -1,11 +1,12 @@
{% extends "docs/doc.html" %}
+{% load i18n %}
-{% block title %}Module Index | Django Documentation{% endblock %}
+{% block title %}{% trans "Module Index | Django Documentation" %}{% endblock %}
{% block toc-wrapper %}{% endblock %}
-{% block current-page-title %}Module Index{% endblock %}
+{% block current-page-title %}{% trans "Module Index" %}{% endblock %}
{% block body %}
-<h1>Module Index</h1>
+<h1>{% trans "Module Index" %}</h1>
<ul class="jump_links">
{% for letter, objects in doc.content %}
17 docs/templates/docs/search.html
View
@@ -1,8 +1,9 @@
{% extends "docs/doc.html" %}
+{% load i18n %}
{% load docs %}
-{% block title %}Search | Django documentation{% endblock %}
+{% block title %}{% trans "Search | Django documentation" %}{% endblock %}
{% block toc-wrapper %}{% endblock %}
{% block breadcrumbs-wrapper %}{% endblock %}
@@ -11,18 +12,18 @@
{% block body %}
<form method="get" action="." id="page_search">
<p>
- <label for="{{ form.q.auto_id }}">Search for:</label>
+ <label for="{{ form.q.auto_id }}">{% trans "Search for:" %}</label>
{{ form.q }}
- <label for="{{ form.release.auto_id }}">in version:</label>
+ <label for="{{ form.release.auto_id }}">{% trans "in version:" %}</label>
{{ form.release }}
- <input type="submit" class="submit" value="Search" />
+ <input type="submit" class="submit" value="{% trans 'Search' %}" />
</p>
</form>
</form>
{% if query %}
{% load highlight %}
- <h2>Results</h2>
+ <h2>{% trans "Results" %}</h2>
<div id="search-results">
{% for result in page.object_list %}
<h3>
@@ -30,7 +31,7 @@
</h3>
<p>{% highlight result.text with query max_length 200 %}</p>
{% empty %}
- <h3>No results found.</h3>
+ <h3>{% trans "No results found." %}</h3>
{% endfor %}
</div>
@@ -39,13 +40,13 @@
{% if page.has_previous %}
<a href="?q={{ query }}&amp;release={{ release.id }}&amp;page={{ page.previous_page_number }}">
{% endif %}
- &laquo; Previous
+ &laquo; {% trans "Previous" %}
{% if page.has_previous %}</a>{% endif %}
|
{% if page.has_next %}
<a href="?q={{ query }}&amp;release={{ release.id }}&amp;page={{ page.next_page_number }}">
{% endif %}
- Next &raquo;
+ {% trans "Next" %} &raquo;
{% if page.has_next %}</a>{% endif %}
</div>
{% endif %}
6 docs/templates/docs/search_form.html
View
@@ -1,14 +1,16 @@
+{% load i18n %}
+
<form action="{% url 'document-search' %}" id="{{ search_form_id }}" class="search">
<div>
<p>
{{ form.q }}
</p>
<p>
- <label for="{{ form.release.auto_id }}">Version:</label>
+ <label for="{{ form.release.auto_id }}">{% trans "Version:" %}</label>
{{ form.release }}
</p>
<p>
- <input type="submit" class="submit" value="Search" />
+ <input type="submit" class="submit" value="{% trans 'Search' %}" />
</p>
</div>
</form>
6 docs/views.py
View
@@ -8,6 +8,7 @@
from django.http import Http404
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
+from django.utils import translation
import haystack.views
@@ -37,6 +38,9 @@ def document(request, lang, version, url):
except UnicodeEncodeError:
raise Http404
+ if lang != 'en':
+ translation.activate(lang)
+
docroot = get_doc_root_or_404(lang, version)
doc_path = get_doc_path_or_404(docroot, url)
@@ -102,6 +106,8 @@ def __init__(self, **kwargs):
def extra_context(self):
# Constuct a context that matches the rest of the doc page views.
current_release = self.form.initial_rel
+ if current_release.lang != 'en':
+ translation.activate(current_release.lang)
return {
'lang': current_release.lang,
'version': current_release.version,
2  fabfile.py
View
@@ -53,6 +53,8 @@ def deploy_code(ref=None):
sudo('git clone %s %s' % (env.git_url, env.code_dir))
with cd(env.code_dir):
sudo('git fetch && git reset --hard %s' % ref)
+ with cd(env.code_dir.child('docs')):
+ managepy('compilemessages', site='docs')
def update_dependencies():
"""
Please sign in to comment.
Something went wrong with that request. Please try again.