Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #20540 -- Added more translatable strings to contrib.admindocs

Thanks lborgav for the initial patch.
  • Loading branch information...
commit 02fd87c821e02864cd14130350c6fd50e9f974db 1 parent f315693
@claudep claudep authored
View
24 django/contrib/admindocs/templates/admin_doc/index.html
@@ -7,27 +7,27 @@
&rsaquo; {% trans 'Documentation' %}</a>
</div>
{% endblock %}
-{% block title %}Documentation{% endblock %}
+{% block title %}{% trans 'Documentation' %}{% endblock %}
{% block content %}
-<h1>Documentation</h1>
+<h1>{% trans 'Documentation' %}</h1>
<div id="content-main">
- <h3><a href="tags/">Tags</a></h3>
- <p>List of all the template tags and their functions.</p>
+ <h3><a href="tags/">{% trans 'Tags</a></h3>
@charettes Collaborator

Missing trans end (%}).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ <p>{% trans 'List of all the template tags and their functions.' %}</p>
- <h3><a href="filters/">Filters</a></h3>
- <p>Filters are actions which can be applied to variables in a template to alter the output.</p>
+ <h3><a href="filters/">{% trans 'Filters</a></h3>
+ <p>{% trans 'Filters are actions which can be applied to variables in a template to alter the output.' %}</p>
- <h3><a href="models/">Models</a></h3>
- <p>Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables.</p>
+ <h3><a href="models/">{% trans 'Models</a></h3>
+ <p>{% trans 'Models are descriptions of all the objects in the system and their associated fields. Each model has a list of fields which can be accessed as template variables' %}.</p>
- <h3><a href="views/">Views</a></h3>
- <p>Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.</p>
+ <h3><a href="views/">{% trans 'Views</a></h3>
+ <p>{% trans 'Each page on the public site is generated by a view. The view defines which template is used to generate the page and which objects are available to that template.' %}</p>
- <h3><a href="bookmarklets/">Bookmarklets</a></h3>
- <p>Tools for your browser to quickly access admin functionality.</p>
+ <h3><a href="bookmarklets/">{% trans 'Bookmarklets</a></h3>
@charettes Collaborator

All <a> trans tags are unclosed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ <p>{% trans 'Tools for your browser to quickly access admin functionality.' %}</p>
</div>
{% endblock %}
View
8 django/contrib/admindocs/templates/admin_doc/missing_docutils.html
@@ -7,16 +7,16 @@
&rsaquo; {% trans 'Documentation' %}</a>
</div>
{% endblock %}
-{% block title %}Please install docutils{% endblock %}
+{% block title %}{% trans 'Please install docutils' %}{% endblock %}
{% block content %}
-<h1>Documentation</h1>
+<h1>{% trans 'Documentation' %}</h1>
<div id="content-main">
- <h3>The admin documentation system requires Python's <a href="http://docutils.sf.net/">docutils</a> library.</h3>
+ <h3>{% blocktrans with "http://docutils.sf.net/" as link %}The admin documentation system requires Python's <a href="{{ link }}">docutils</a> library.{% endblocktrans %}</h3>
- <p>Please ask your administrators to install <a href="http://docutils.sf.net/">docutils</a>.</p>
+ <p>{% blocktrans with "http://docutils.sf.net/" as link %}Please ask your administrators to install <a href="{{ link }}">docutils</a>.{% endblocktrans %}</p>
</div>
{% endblock %}
View
10 django/contrib/admindocs/templates/admin_doc/model_detail.html
@@ -18,7 +18,7 @@
</div>
{% endblock %}
-{% block title %}Model: {{ name }}{% endblock %}
+{% block title %}{% blocktrans %}Model: {{ name }}{% endblocktrans %}{% endblock %}
{% block content %}
<div id="content-main">
@@ -32,9 +32,9 @@
<table class="model">
<thead>
<tr>
- <th>Field</th>
- <th>Type</th>
- <th>Description</th>
+ <th>{% trans 'Field' %}</th>
+ <th>{% trans 'Type' %}</th>
+ <th>{% trans 'Description' %}</th>
</tr>
</thead>
<tbody>
@@ -49,6 +49,6 @@
</table>
</div>
-<p class="small"><a href="{% url 'django-admindocs-models-index' %}">&lsaquo; Back to Models Documentation</a></p>
+<p class="small"><a href="{% url 'django-admindocs-models-index' %}">&lsaquo; {% trans 'Back to Models Documentation' %}</a></p>
</div>
{% endblock %}
View
6 django/contrib/admindocs/templates/admin_doc/model_index.html
@@ -11,11 +11,11 @@
</div>
{% endblock %}
-{% block title %}Models{% endblock %}
+{% block title %}{% trans 'Models' %}{% endblock %}
{% block content %}
-<h1>Model documentation</h1>
+<h1>{% trans 'Model documentation' %}</h1>
{% regroup models by app_label as grouped_models %}
@@ -40,7 +40,7 @@ <h2 id="app-{{ group.grouper }}">{{ group.grouper|capfirst }}</h2>
{% block sidebar %}
<div id="content-related" class="sidebar">
<div class="module">
-<h2>Model groups</h2>
+<h2>{% trans 'Model groups' %}</h2>
<ul>
{% regroup models by app_label as grouped_models %}
{% for group in grouped_models %}
View
10 django/contrib/admindocs/templates/admin_doc/template_detail.html
@@ -10,20 +10,20 @@
</div>
{% endblock %}
-{% block title %}Template: {{ name }}{% endblock %}
+{% block title %}{% blocktrans %}Template: {{ name }}{% endblocktrans %}{% endblock %}
{% block content %}
-<h1>Template: "{{ name }}"</h1>
+<h1>{% blocktrans %}Template: "{{ name }}"{% endblocktrans %}</h1>
{% regroup templates|dictsort:"site_id" by site as templates_by_site %}
{% for group in templates_by_site %}
- <h2>Search path for template "{{ name }}" on {{ group.grouper }}:</h2>
+ <h2>{% blocktrans with group.grouper as grouper %}Search path for template "{{ name }}" on {{ grouper }}:{% endblocktrans %}</h2>
<ol>
{% for template in group.list|dictsort:"order" %}
- <li><code>{{ template.file }}</code>{% if not template.exists %} <em>(does not exist)</em>{% endif %}</li>
+ <li><code>{{ template.file }}</code>{% if not template.exists %} <em>{% trans '(does not exist)' %}</em>{% endif %}</li>
{% endfor %}
</ol>
{% endfor %}
-<p class="small"><a href="{% url 'django-admindocs-docroot' %}">&lsaquo; Back to Documentation</a></p>
+<p class="small"><a href="{% url 'django-admindocs-docroot' %}">&lsaquo; {% trans 'Back to Documentation' %}</a></p>
{% endblock %}
View
10 django/contrib/admindocs/templates/admin_doc/template_filter_index.html
@@ -9,18 +9,18 @@
&rsaquo; {% trans 'Filters' %}
</div>
{% endblock %}
-{% block title %}Template filters{% endblock %}
+{% block title %}{% trans 'Template filters' %}{% endblock %}
{% block content %}
-<h1>Template filter documentation</h1>
+<h1>{% trans 'Template filter documentation' %}</h1>
<div id="content-main">
{% regroup filters|dictsort:"library" by library as filter_libraries %}
{% for library in filter_libraries %}
<div class="module">
- <h2>{% firstof library.grouper "Built-in filters" %}</h2>
- {% if library.grouper %}<p class="small quiet">To use these filters, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the filter.</p><hr />{% endif %}
+ <h2>{% firstof library.grouper _("Built-in filters") %}</h2>
+ {% if library.grouper %}<p class="small quiet">{% blocktrans with code="{"|add:"% load "|add:library.grouper|add:" %"|add:"}" %}To use these filters, put <code>{{ code }}</code> in your template before using the filter.{% endblocktrans %}</p><hr />{% endif %}
{% for filter in library.list|dictsort:"name" %}
<h3 id="{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</h3>
{{ filter.title }}
@@ -40,7 +40,7 @@ <h3 id="{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.na
{% regroup filters|dictsort:"library" by library as filter_libraries %}
{% for library in filter_libraries %}
<div class="module">
- <h2>{% firstof library.grouper "Built-in filters" %}</h2>
+ <h2>{% firstof library.grouper _("Built-in filters") %}</h2>
<ul>
{% for filter in library.list|dictsort:"name" %}
<li><a href="#{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</a></li>
View
10 django/contrib/admindocs/templates/admin_doc/template_tag_index.html
@@ -9,18 +9,18 @@
&rsaquo; {% trans 'Tags' %}
</div>
{% endblock %}
-{% block title %}Template tags{% endblock %}
+{% block title %}{% trans 'Template tags' %}{% endblock %}
{% block content %}
-<h1>Template tag documentation</h1>
+<h1>{% trans 'Template tag documentation' %}</h1>
<div id="content-main">
{% regroup tags|dictsort:"library" by library as tag_libraries %}
{% for library in tag_libraries %}
<div class="module">
- <h2>{% firstof library.grouper "Built-in tags" %}</h2>
- {% if library.grouper %}<p class="small quiet">To use these tags, put <code>{% templatetag openblock %} load {{ library.grouper }} {% templatetag closeblock %}</code> in your template before using the tag.</p><hr />{% endif %}
+ <h2>{% firstof library.grouper _("Built-in tags") %}</h2>
+ {% if library.grouper %}<p class="small quiet">{% blocktrans with code="{"|add:"% load "|add:library.grouper|add:" %"|add:"}" %}To use these tags, put <code>{{ code }}</code> in your template before using the tag.{% endblocktrans %}</p><hr />{% endif %}
{% for tag in library.list|dictsort:"name" %}
<h3 id="{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</h3>
<h4>{{ tag.title|striptags }}</h4>
@@ -40,7 +40,7 @@ <h3 id="{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}<
{% regroup tags|dictsort:"library" by library as tag_libraries %}
{% for library in tag_libraries %}
<div class="module">
- <h2>{% firstof library.grouper "Built-in tags" %}</h2>
+ <h2>{% firstof library.grouper _("Built-in tags") %}</h2>
<ul>
{% for tag in library.list|dictsort:"name" %}
<li><a href="#{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</a></li>
View
8 django/contrib/admindocs/templates/admin_doc/view_detail.html
@@ -9,7 +9,7 @@
&rsaquo; {{ name }}
</div>
{% endblock %}
-{% block title %}View: {{ name }}{% endblock %}
+{% block title %}{% trans 'View: {{ name }}' %}{% endblock %}
@charettes Collaborator

Shouldn't we use {% blocktrans %} here instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
{% block content %}
@@ -20,14 +20,14 @@ <h2 class="subhead">{{ summary|striptags }}</h2>
{{ body }}
{% if meta.Context %}
-<h3>Context:</h3>
+<h3>{% trans 'Context:' %}</h3>
<p>{{ meta.Context }}</p>
{% endif %}
{% if meta.Templates %}
-<h3>Templates:</h3>
+<h3>{% trans 'Templates:' %}</h3>
<p>{{ meta.Templates }}</p>
{% endif %}
-<p class="small"><a href="{% url 'django-admindocs-views-index' %}">&lsaquo; Back to Views Documentation</a></p>
+<p class="small"><a href="{% url 'django-admindocs-views-index' %}">&lsaquo; {% trans 'Back to Views Documentation' %}</a></p>
{% endblock %}
View
12 django/contrib/admindocs/templates/admin_doc/view_index.html
@@ -9,17 +9,17 @@
&rsaquo; {% trans 'Views' %}
</div>
{% endblock %}
-{% block title %}Views{% endblock %}
+{% block title %}{% trans 'Views' %}{% endblock %}
{% block content %}
-<h1>View documentation</h1>
+<h1>{% trans 'View documentation' %}</h1>
{% regroup views|dictsort:"site_id" by site as views_by_site %}
<div id="content-related" class="sidebar">
<div class="module">
-<h2>Jump to site</h2>
+<h2>{% trans 'Jump to site' %}</h2>
<ul>
{% for site_views in views_by_site %}
<li><a href="#site{{ site_views.grouper.id }}">{{ site_views.grouper.name }}</a></li>
@@ -32,12 +32,12 @@
{% for site_views in views_by_site %}
<div class="module">
-<h2 id="site{{ site_views.grouper.id }}">Views by URL on {{ site_views.grouper.name }}</h2>
+<h2 id="site{{ site_views.grouper.id }}">{% blocktrans with site_views.grouper.name as name %}Views by URL on {{ name }}{% endblocktrans %}</h2>
{% for view in site_views.list|dictsort:"url" %}
{% ifchanged %}
<h3><a href="{% url 'django-admindocs-views-detail' view=view.full_name %}">{{ view.url }}</a></h3>
-<p class="small quiet">View function: {{ view.full_name }}</p>
+<p class="small quiet">{% blocktrans with view.full_name as name %}View function: {{ name }}{% endblocktrans %}</p>
<p>{{ view.title }}</p>
<hr />
{% endifchanged %}
@@ -46,5 +46,3 @@ <h2 id="site{{ site_views.grouper.id }}">Views by URL on {{ site_views.grouper.n
{% endfor %}
</div>
{% endblock %}
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.