1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #30585 -- Updated project templates and tests to use (block)translate tags.

This commit is contained in:
Mike Hansen
2019-09-23 08:31:21 -07:00
committed by Mariusz Felisiak
parent d291c72bf2
commit 35d36d9462
74 changed files with 547 additions and 532 deletions

View File

@@ -2,5 +2,5 @@
{% load i18n %}
{% block actions-submit %}
<button type="submit" class="button override-actions" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button>
<button type="submit" class="button override-actions" title="{% translate "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% translate "Go" %}</button>
{% endblock %}

View File

@@ -2,6 +2,6 @@
{% load i18n admin_urls %}
{% block object-tools-items %}
<li><a href="#" id="change-form-export" class="override-change_form_object_tools change-form-object-tools-item">{% trans "Export" %}</a></li>
<li><a href="#" id="change-form-export" class="override-change_form_object_tools change-form-object-tools-item">{% translate "Export" %}</a></li>
{{ block.super }}
{% endblock %}

View File

@@ -2,6 +2,6 @@
{% load i18n admin_urls %}
{% block object-tools-items %}
<li><a href="#" id="change-list-export" class="override-change_list_object_tools change-list-object-tools-item">{% trans "Export" %}</a></li>
<li><a href="#" id="change-list-export" class="override-change_list_object_tools change-list-object-tools-item">{% translate "Export" %}</a></li>
{{ block.super }}
{% endblock %}

View File

@@ -14,9 +14,9 @@
{% if header.sortable %}
{% if header.sort_priority > 0 %}
<div class="sortoptions">
<a class="sortremove" href="{{ header.url_remove }}" title="{% trans "Remove from sorting" %}"></a>
{% if num_sorted_fields > 1 %}<span class="sortpriority" title="{% blocktrans with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktrans %}">{{ header.sort_priority }}</span>{% endif %}
<a href="{{ header.url_toggle }}" class="toggle {% if header.ascending %}ascending{% else %}descending{% endif %}" title="{% trans "Toggle sorting" %}"></a>
<a class="sortremove" href="{{ header.url_remove }}" title="{% translate "Remove from sorting" %}"></a>
{% if num_sorted_fields > 1 %}<span class="sortpriority" title="{% blocktranslate with priority_number=header.sort_priority %}Sorting priority: {{ priority_number }}{% endblocktranslate %}">{{ header.sort_priority }}</span>{% endif %}
<a href="{{ header.url_toggle }}" class="toggle {% if header.ascending %}ascending{% else %}descending{% endif %}" title="{% translate "Toggle sorting" %}"></a>
</div>
{% endif %}
{% endif %}

View File

@@ -5,5 +5,5 @@
<select id="date-selector" class="override-date_hierarchy">{% for choice in choices %}
<option{% if choice.link %} value="{{ choice.link }}"{% endif %}>{{ choice.title }}</option>
{% endfor %}</select>
<button id="date-selected">{% trans "Go" %}</button>
<button id="date-selected">{% translate "Go" %}</button>
{% endblock %}

View File

@@ -7,6 +7,6 @@
{% endfor %}
{% endif %}
{{ cl.result_count }} {% if cl.result_count == 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endif %}
{% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url }}" class="showall">{% trans 'Show all' %}</a>{% endif %}
{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% trans 'Save' %}"/>{% endif %}
{% if show_all_url %}&nbsp;&nbsp;<a href="{{ show_all_url }}" class="showall">{% translate 'Show all' %}</a>{% endif %}
{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% translate 'Save' %}"/>{% endif %}
</p>

View File

@@ -4,9 +4,9 @@
<div><!-- DIV needed for valid HTML -->
<label for="searchbar"><img src="{% static "admin/img/search.svg" %}" alt="Search" /></label>
<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" autofocus />
<input type="submit" value="{% trans 'Search' %}" />
<input type="submit" value="{% translate 'Search' %}" />
{% if show_result_count %}
<span class="small quiet">{% blocktrans count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktrans with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktrans %}{% else %}{% trans "Show all" %}{% endif %}</a>)</span>
<span class="small quiet">{% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} (<a href="?{% if cl.is_popup %}_popup=1{% endif %}">{% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}</a>)</span>
{% endif %}
{% for pair in cl.params.items %}
{% if pair.0 != search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endif %}

View File

@@ -2,6 +2,6 @@
{% load i18n admin_urls %}
{% block submit-row %}
{% if show_publish %}<input type="submit" value="{% trans 'Publish' %}" class="default" name="_publish" />{% endif %}
{% if show_publish %}<input type="submit" value="{% translate 'Publish' %}" class="default" name="_publish" />{% endif %}
{{ block.super }}
{% endblock %}