Author: jezdez
Date: 2010-03-01 08:34:07 -0600 (Mon, 01 Mar 2010)
New Revision: 12626

Modified:
   django/trunk/django/contrib/admin/options.py
   django/trunk/django/contrib/admin/templates/admin/actions.html
Log:
Fixed #12903 - Added plural forms to a few strings in the admin actions 
template.

Modified: django/trunk/django/contrib/admin/options.py
===================================================================
--- django/trunk/django/contrib/admin/options.py        2010-03-01 10:19:24 UTC 
(rev 12625)
+++ django/trunk/django/contrib/admin/options.py        2010-03-01 14:34:07 UTC 
(rev 12626)
@@ -1037,13 +1037,15 @@
         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,

Modified: django/trunk/django/contrib/admin/templates/admin/actions.html
===================================================================
--- django/trunk/django/contrib/admin/templates/admin/actions.html      
2010-03-01 10:19:24 UTC (rev 12625)
+++ django/trunk/django/contrib/admin/templates/admin/actions.html      
2010-03-01 14:34:07 UTC (rev 12626)
@@ -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>
-

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to