Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed translatability of application names in admin app.

Also, made usage of the `filter` template tag consistent in some
breadcrumbs elements across the different admin templates.

Fixes #10436.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17378 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 203c4fef4d4f9c3a241cef0927ae895fcfe9ec48 1 parent aef0283
Ramiro Morales authored January 19, 2012
6  django/contrib/admin/sites.py
@@ -358,7 +358,7 @@ def index(self, request, extra_context=None):
358 358
                         app_dict[app_label]['models'].append(model_dict)
359 359
                     else:
360 360
                         app_dict[app_label] = {
361  
-                            'name': app_label.title(),
  361
+                            'name': app_label,
362 362
                             'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name),
363 363
                             'has_module_perms': has_module_perms,
364 364
                             'models': [model_dict],
@@ -415,7 +415,7 @@ def app_index(self, request, app_label, extra_context=None):
415 415
                             # something to display, add in the necessary meta
416 416
                             # information.
417 417
                             app_dict = {
418  
-                                'name': app_label.title(),
  418
+                                'name': app_label,
419 419
                                 'app_url': '',
420 420
                                 'has_module_perms': has_module_perms,
421 421
                                 'models': [model_dict],
@@ -425,7 +425,7 @@ def app_index(self, request, app_label, extra_context=None):
425 425
         # Sort the models alphabetically within each app.
426 426
         app_dict['models'].sort(key=lambda x: x['name'])
427 427
         context = {
428  
-            'title': _('%s administration') % capfirst(app_label),
  428
+            'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
429 429
             'app_list': [app_dict],
430 430
         }
431 431
         context.update(extra_context or {})
2  django/contrib/admin/templates/admin/app_index.html
@@ -8,7 +8,7 @@
8 8
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
9 9
 &rsaquo;
10 10
 {% for app in app_list %}
11  
-{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
  11
+{% trans app.name|title %}
12 12
 {% endfor %}
13 13
 </div>
14 14
 {% endblock %}
4  django/contrib/admin/templates/admin/auth/user/change_password.html
@@ -13,8 +13,8 @@
13 13
 {% block breadcrumbs %}
14 14
 <div class="breadcrumbs">
15 15
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
16  
-&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_label|capfirst|escape }}</a>
17  
-&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
  16
+&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans opts.app_label|capfirst|escape %}</a>
  17
+&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
18 18
 &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a>
19 19
 &rsaquo; {% trans 'Change password' %}
20 20
 </div>
4  django/contrib/admin/templates/admin/change_form.html
@@ -19,8 +19,8 @@
19 19
 {% block breadcrumbs %}
20 20
 <div class="breadcrumbs">
21 21
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
22  
-&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst|escape }}</a>
23  
-&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
  22
+&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans app_label|capfirst|escape %}</a>
  23
+&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>{% else %}{{ opts.verbose_name_plural|capfirst|escape }}{% endif %}
24 24
 &rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
25 25
 </div>
26 26
 {% endblock %}
4  django/contrib/admin/templates/admin/change_list.html
@@ -41,8 +41,8 @@
41 41
 {% block breadcrumbs %}
42 42
 <div class="breadcrumbs">
43 43
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
44  
-&rsaquo; <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ app_label|capfirst|escape }}</a>
45  
-&rsaquo; {{ cl.opts.verbose_name_plural|capfirst }}
  44
+&rsaquo; <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{% trans app_label|capfirst|escape %}</a>
  45
+&rsaquo; {{ cl.opts.verbose_name_plural|capfirst|escape }}
46 46
 </div>
47 47
 {% endblock %}
48 48
 {% endif %}
2  django/contrib/admin/templates/admin/delete_confirmation.html
@@ -6,7 +6,7 @@
6 6
 {% block breadcrumbs %}
7 7
 <div class="breadcrumbs">
8 8
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
9  
-&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst }}</a>
  9
+&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans app_label|capfirst|escape %}</a>
10 10
 &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
11 11
 &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
12 12
 &rsaquo; {% trans 'Delete' %}
4  django/contrib/admin/templates/admin/delete_selected_confirmation.html
@@ -6,8 +6,8 @@
6 6
 {% block breadcrumbs %}
7 7
 <div class="breadcrumbs">
8 8
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
9  
-&rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
10  
-&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
  9
+&rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{% trans app_label|capfirst|escape %}</a>
  10
+&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
11 11
 &rsaquo; {% trans 'Delete multiple objects' %}
12 12
 </div>
13 13
 {% endblock %}
4  django/contrib/admin/templates/admin/index.html
@@ -15,8 +15,8 @@
15 15
 {% if app_list %}
16 16
     {% for app in app_list %}
17 17
         <div class="module">
18  
-        <table summary="{% blocktrans with name=app.name %}Models available in the {{ name }} application.{% endblocktrans %}">
19  
-        <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with name=app.name %}{{ name }}{% endblocktrans %}</a></caption>
  18
+        <table summary="{% blocktrans with name=app.name|title %}Models available in the {{ name }} application.{% endblocktrans %}">
  19
+        <caption><a href="{{ app.app_url }}" class="section">{% trans app.name|title %}</a></caption>
20 20
         {% for model in app.models %}
21 21
             <tr>
22 22
             {% if model.admin_url %}
2  django/contrib/admin/templates/admin/object_history.html
@@ -6,7 +6,7 @@
6 6
 {% block breadcrumbs %}
7 7
 <div class="breadcrumbs">
8 8
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
9  
-&rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
  9
+&rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{% trans app_label|capfirst|escape %}</a>
10 10
 &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
11 11
 &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
12 12
 &rsaquo; {% trans 'History' %}

0 notes on commit 203c4fe

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