Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #12903 - Added plural forms to a few strings in the admin actio…

…ns template.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12626 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2dafe4ac3a8236621b4ee58bb2a17ebfeb06b900 1 parent 0d2a24f
@jezdez jezdez authored
View
12 django/contrib/admin/options.py
@@ -1037,13 +1037,15 @@ def changelist_view(self, request, extra_context=None):
else:
action_form = None
- if cl.result_count == 1:
- module_name = force_unicode(opts.verbose_name)
- else:
- module_name = force_unicode(opts.verbose_name_plural)
+ selection_note = ungettext('of %(count)d selected',
+ 'of %(count)d selected', len(cl.result_list))
+ selection_note_all = ungettext('%(total_count)s selected',
+ 'All %(total_count)s selected', cl.result_count)
context = {
- 'module_name': module_name,
+ 'module_name': force_unicode(opts.verbose_name_plural),
+ 'selection_note': selection_note % {'count': len(cl.result_list)},
+ 'selection_note_all': selection_note_all % {'total_count': cl.result_count},
'title': cl.title,
'is_popup': cl.is_popup,
'cl': cl,
View
11 django/contrib/admin/templates/admin/actions.html
@@ -3,18 +3,13 @@
{% for field in action_form %}{% if field.label %}<label>{{ field.label }} {% endif %}{{ field }}{% if field.label %}</label>{% endif %}{% endfor %}
<button type="submit" class="button" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button>
{% if actions_selection_counter %}
- <span class="action-counter">
- {% blocktrans with cl.result_count as total_count %}<span class="_acnt">0</span> of {{ total_count }} {{ module_name }} selected{% endblocktrans %}
- </span>
+ <span class="action-counter"><span class="_acnt">0</span> {{ selection_note }}</span>
{% if cl.result_count != cl.result_list|length %}
- <span class="all">
- {% blocktrans with cl.result_count as total_count %}All {{ total_count }} {{ module_name }} selected{% endblocktrans %}
- </span>
+ <span class="all">{{ selection_note_all }}</span>
<span class="question">
- <a href="javascript:;" title="{% trans "Click here to select all objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
+ <a href="javascript:;" title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
</span>
<span class="clear"><a href="javascript:;">{% trans "Clear selection" %}</a></span>
{% endif %}
{% endif %}
</div>
-

0 comments on commit 2dafe4a

Please sign in to comment.
Something went wrong with that request. Please try again.