mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #20540 -- Added more translatable strings to contrib.admindocs
Thanks lborgav for the initial patch.
This commit is contained in:
		| @@ -7,27 +7,27 @@ | |||||||
| › {% trans 'Documentation' %}</a> | › {% trans 'Documentation' %}</a> | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
| {% block title %}Documentation{% endblock %} | {% block title %}{% trans 'Documentation' %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
|  |  | ||||||
| <h1>Documentation</h1> | <h1>{% trans 'Documentation' %}</h1> | ||||||
|  |  | ||||||
| <div id="content-main"> | <div id="content-main"> | ||||||
|   <h3><a href="tags/">Tags</a></h3> |   <h3><a href="tags/">{% trans 'Tags</a></h3> | ||||||
|   <p>List of all the template tags and their functions.</p> |   <p>{% trans 'List of all the template tags and their functions.' %}</p> | ||||||
|  |  | ||||||
|   <h3><a href="filters/">Filters</a></h3> |   <h3><a href="filters/">{% trans 'Filters</a></h3> | ||||||
|   <p>Filters are actions which can be applied to variables in a template to alter the output.</p> |   <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> |   <h3><a href="models/">{% trans '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> |   <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> |   <h3><a href="views/">{% trans '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> |   <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> |   <h3><a href="bookmarklets/">{% trans 'Bookmarklets</a></h3> | ||||||
|     <p>Tools for your browser to quickly access admin functionality.</p> |   <p>{% trans 'Tools for your browser to quickly access admin functionality.' %}</p> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
| {% endblock %} | {% endblock %} | ||||||
|   | |||||||
| @@ -7,16 +7,16 @@ | |||||||
| › {% trans 'Documentation' %}</a> | › {% trans 'Documentation' %}</a> | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
| {% block title %}Please install docutils{% endblock %} | {% block title %}{% trans 'Please install docutils' %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
|  |  | ||||||
| <h1>Documentation</h1> | <h1>{% trans 'Documentation' %}</h1> | ||||||
|  |  | ||||||
| <div id="content-main"> | <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> | </div> | ||||||
|  |  | ||||||
| {% endblock %} | {% endblock %} | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ | |||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|  |  | ||||||
| {% block title %}Model: {{ name }}{% endblock %} | {% block title %}{% blocktrans %}Model: {{ name }}{% endblocktrans %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
| <div id="content-main"> | <div id="content-main"> | ||||||
| @@ -32,9 +32,9 @@ | |||||||
| <table class="model"> | <table class="model"> | ||||||
| <thead> | <thead> | ||||||
| <tr> | <tr> | ||||||
|     <th>Field</th> |     <th>{% trans 'Field' %}</th> | ||||||
|     <th>Type</th> |     <th>{% trans 'Type' %}</th> | ||||||
|     <th>Description</th> |     <th>{% trans 'Description' %}</th> | ||||||
| </tr> | </tr> | ||||||
| </thead> | </thead> | ||||||
| <tbody> | <tbody> | ||||||
| @@ -49,6 +49,6 @@ | |||||||
| </table> | </table> | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
| <p class="small"><a href="{% url 'django-admindocs-models-index' %}">‹ Back to Models Documentation</a></p> | <p class="small"><a href="{% url 'django-admindocs-models-index' %}">‹ {% trans 'Back to Models Documentation' %}</a></p> | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|   | |||||||
| @@ -11,11 +11,11 @@ | |||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|  |  | ||||||
| {% block title %}Models{% endblock %} | {% block title %}{% trans 'Models' %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
|  |  | ||||||
| <h1>Model documentation</h1> | <h1>{% trans 'Model documentation' %}</h1> | ||||||
|  |  | ||||||
| {% regroup models by app_label as grouped_models %} | {% regroup models by app_label as grouped_models %} | ||||||
|  |  | ||||||
| @@ -40,7 +40,7 @@ | |||||||
| {% block sidebar %} | {% block sidebar %} | ||||||
| <div id="content-related" class="sidebar"> | <div id="content-related" class="sidebar"> | ||||||
| <div class="module"> | <div class="module"> | ||||||
| <h2>Model groups</h2> | <h2>{% trans 'Model groups' %}</h2> | ||||||
| <ul> | <ul> | ||||||
| {% regroup models by app_label as grouped_models %} | {% regroup models by app_label as grouped_models %} | ||||||
| {% for group in grouped_models %} | {% for group in grouped_models %} | ||||||
|   | |||||||
| @@ -10,20 +10,20 @@ | |||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|  |  | ||||||
| {% block title %}Template: {{ name }}{% endblock %} | {% block title %}{% blocktrans %}Template: {{ name }}{% endblocktrans %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
| <h1>Template: "{{ name }}"</h1> | <h1>{% blocktrans %}Template: "{{ name }}"{% endblocktrans %}</h1> | ||||||
|  |  | ||||||
| {% regroup templates|dictsort:"site_id" by site as templates_by_site %} | {% regroup templates|dictsort:"site_id" by site as templates_by_site %} | ||||||
| {% for group in 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> |     <ol> | ||||||
|     {% for template in group.list|dictsort:"order" %} |     {% 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 %} |     {% endfor %} | ||||||
|     </ol> |     </ol> | ||||||
| {% endfor %} | {% endfor %} | ||||||
|  |  | ||||||
| <p class="small"><a href="{% url 'django-admindocs-docroot' %}">‹ Back to Documentation</a></p> | <p class="small"><a href="{% url 'django-admindocs-docroot' %}">‹ {% trans 'Back to Documentation' %}</a></p> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|   | |||||||
| @@ -9,18 +9,18 @@ | |||||||
| › {% trans 'Filters' %} | › {% trans 'Filters' %} | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
| {% block title %}Template filters{% endblock %} | {% block title %}{% trans 'Template filters' %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
|  |  | ||||||
| <h1>Template filter documentation</h1> | <h1>{% trans 'Template filter documentation' %}</h1> | ||||||
|  |  | ||||||
| <div id="content-main"> | <div id="content-main"> | ||||||
| {% regroup filters|dictsort:"library" by library as filter_libraries %} | {% regroup filters|dictsort:"library" by library as filter_libraries %} | ||||||
| {% for library in filter_libraries %} | {% for library in filter_libraries %} | ||||||
| <div class="module"> | <div class="module"> | ||||||
|     <h2>{% firstof library.grouper "Built-in filters" %}</h2> |     <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 %} |     {% 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" %} |     {% for filter in library.list|dictsort:"name" %} | ||||||
|     <h3 id="{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</h3> |     <h3 id="{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</h3> | ||||||
|     {{ filter.title }} |     {{ filter.title }} | ||||||
| @@ -40,7 +40,7 @@ | |||||||
| {% regroup filters|dictsort:"library" by library as filter_libraries %} | {% regroup filters|dictsort:"library" by library as filter_libraries %} | ||||||
| {% for library in filter_libraries %} | {% for library in filter_libraries %} | ||||||
| <div class="module"> | <div class="module"> | ||||||
|     <h2>{% firstof library.grouper "Built-in filters" %}</h2> |     <h2>{% firstof library.grouper _("Built-in filters") %}</h2> | ||||||
|     <ul> |     <ul> | ||||||
|     {% for filter in library.list|dictsort:"name" %} |     {% for filter in library.list|dictsort:"name" %} | ||||||
|         <li><a href="#{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</a></li> |         <li><a href="#{{ library.grouper|default:"built_in" }}-{{ filter.name }}">{{ filter.name }}</a></li> | ||||||
|   | |||||||
| @@ -9,18 +9,18 @@ | |||||||
| › {% trans 'Tags' %} | › {% trans 'Tags' %} | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
| {% block title %}Template tags{% endblock %} | {% block title %}{% trans 'Template tags' %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
|  |  | ||||||
| <h1>Template tag documentation</h1> | <h1>{% trans 'Template tag documentation' %}</h1> | ||||||
|  |  | ||||||
| <div id="content-main"> | <div id="content-main"> | ||||||
| {% regroup tags|dictsort:"library" by library as tag_libraries %} | {% regroup tags|dictsort:"library" by library as tag_libraries %} | ||||||
| {% for library in tag_libraries %} | {% for library in tag_libraries %} | ||||||
| <div class="module"> | <div class="module"> | ||||||
|     <h2>{% firstof library.grouper "Built-in tags" %}</h2> |     <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 %} |     {% 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" %} |     {% for tag in library.list|dictsort:"name" %} | ||||||
|     <h3 id="{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</h3> |     <h3 id="{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</h3> | ||||||
|     <h4>{{ tag.title|striptags }}</h4> |     <h4>{{ tag.title|striptags }}</h4> | ||||||
| @@ -40,7 +40,7 @@ | |||||||
| {% regroup tags|dictsort:"library" by library as tag_libraries %} | {% regroup tags|dictsort:"library" by library as tag_libraries %} | ||||||
| {% for library in tag_libraries %} | {% for library in tag_libraries %} | ||||||
| <div class="module"> | <div class="module"> | ||||||
|     <h2>{% firstof library.grouper "Built-in tags" %}</h2> |     <h2>{% firstof library.grouper _("Built-in tags") %}</h2> | ||||||
|     <ul> |     <ul> | ||||||
|     {% for tag in library.list|dictsort:"name" %} |     {% for tag in library.list|dictsort:"name" %} | ||||||
|         <li><a href="#{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</a></li> |         <li><a href="#{{ library.grouper|default:"built_in" }}-{{ tag.name }}">{{ tag.name }}</a></li> | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
| › {{ name }} | › {{ name }} | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
| {% block title %}View: {{ name }}{% endblock %} | {% block title %}{% trans 'View: {{ name }}' %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
|  |  | ||||||
| @@ -20,14 +20,14 @@ | |||||||
| {{ body }} | {{ body }} | ||||||
|  |  | ||||||
| {% if meta.Context %} | {% if meta.Context %} | ||||||
| <h3>Context:</h3> | <h3>{% trans 'Context:' %}</h3> | ||||||
| <p>{{ meta.Context }}</p> | <p>{{ meta.Context }}</p> | ||||||
| {% endif %} | {% endif %} | ||||||
|  |  | ||||||
| {% if meta.Templates %} | {% if meta.Templates %} | ||||||
| <h3>Templates:</h3> | <h3>{% trans 'Templates:' %}</h3> | ||||||
| <p>{{ meta.Templates }}</p> | <p>{{ meta.Templates }}</p> | ||||||
| {% endif %} | {% endif %} | ||||||
|  |  | ||||||
| <p class="small"><a href="{% url 'django-admindocs-views-index' %}">‹ Back to Views Documentation</a></p> | <p class="small"><a href="{% url 'django-admindocs-views-index' %}">‹ {% trans 'Back to Views Documentation' %}</a></p> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|   | |||||||
| @@ -9,17 +9,17 @@ | |||||||
| › {% trans 'Views' %} | › {% trans 'Views' %} | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
| {% block title %}Views{% endblock %} | {% block title %}{% trans 'Views' %}{% endblock %} | ||||||
|  |  | ||||||
| {% block content %} | {% block content %} | ||||||
|  |  | ||||||
| <h1>View documentation</h1> | <h1>{% trans 'View documentation' %}</h1> | ||||||
|  |  | ||||||
| {% regroup views|dictsort:"site_id" by site as views_by_site %} | {% regroup views|dictsort:"site_id" by site as views_by_site %} | ||||||
|  |  | ||||||
| <div id="content-related" class="sidebar"> | <div id="content-related" class="sidebar"> | ||||||
| <div class="module"> | <div class="module"> | ||||||
| <h2>Jump to site</h2> | <h2>{% trans 'Jump to site' %}</h2> | ||||||
| <ul> | <ul> | ||||||
|     {% for site_views in views_by_site %} |     {% for site_views in views_by_site %} | ||||||
|     <li><a href="#site{{ site_views.grouper.id }}">{{ site_views.grouper.name }}</a></li> |     <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 %} | {% for site_views in views_by_site %} | ||||||
| <div class="module"> | <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" %} | {% for view in site_views.list|dictsort:"url" %} | ||||||
| {% ifchanged %} | {% ifchanged %} | ||||||
| <h3><a href="{% url 'django-admindocs-views-detail' view=view.full_name %}">{{ view.url }}</a></h3> | <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> | <p>{{ view.title }}</p> | ||||||
| <hr /> | <hr /> | ||||||
| {% endifchanged %} | {% endifchanged %} | ||||||
| @@ -46,5 +46,3 @@ | |||||||
| {% endfor %} | {% endfor %} | ||||||
| </div> | </div> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user