Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Jannis Leidel authored March 01, 2010
12  django/contrib/admin/options.py
@@ -1037,13 +1037,15 @@ def changelist_view(self, request, extra_context=None):
1037 1037
         else:
1038 1038
             action_form = None
1039 1039
 
1040  
-        if cl.result_count == 1:
1041  
-            module_name = force_unicode(opts.verbose_name)
1042  
-        else:
1043  
-            module_name = force_unicode(opts.verbose_name_plural)
  1040
+        selection_note = ungettext('of %(count)d selected',
  1041
+            'of %(count)d selected', len(cl.result_list))
  1042
+        selection_note_all = ungettext('%(total_count)s selected',
  1043
+            'All %(total_count)s selected', cl.result_count)
1044 1044
 
1045 1045
         context = {
1046  
-            'module_name': module_name,
  1046
+            'module_name': force_unicode(opts.verbose_name_plural),
  1047
+            'selection_note': selection_note % {'count': len(cl.result_list)},
  1048
+            'selection_note_all': selection_note_all % {'total_count': cl.result_count},
1047 1049
             'title': cl.title,
1048 1050
             'is_popup': cl.is_popup,
1049 1051
             'cl': cl,
11  django/contrib/admin/templates/admin/actions.html
@@ -3,18 +3,13 @@
3 3
     {% for field in action_form %}{% if field.label %}<label>{{ field.label }} {% endif %}{{ field }}{% if field.label %}</label>{% endif %}{% endfor %}
4 4
     <button type="submit" class="button" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button>
5 5
     {% if actions_selection_counter %}
6  
-        <span class="action-counter">
7  
-            {% blocktrans with cl.result_count as total_count %}<span class="_acnt">0</span> of {{ total_count }} {{ module_name }} selected{% endblocktrans %}
8  
-        </span>
  6
+        <span class="action-counter"><span class="_acnt">0</span> {{ selection_note }}</span>
9 7
         {% if cl.result_count != cl.result_list|length %}
10  
-        <span class="all">
11  
-            {% blocktrans with cl.result_count as total_count %}All {{ total_count }} {{ module_name }} selected{% endblocktrans %}
12  
-        </span>
  8
+        <span class="all">{{ selection_note_all }}</span>
13 9
         <span class="question">
14  
-            <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>
  10
+            <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>
15 11
         </span>
16 12
         <span class="clear"><a href="javascript:;">{% trans "Clear selection" %}</a></span>
17 13
         {% endif %}
18 14
     {% endif %}
19 15
 </div>
20  
-

0 notes on commit 2dafe4a

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