From 203c4fef4d4f9c3a241cef0927ae895fcfe9ec48 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Thu, 19 Jan 2012 11:23:31 +0000 Subject: [PATCH] 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 --- django/contrib/admin/sites.py | 6 +++--- django/contrib/admin/templates/admin/app_index.html | 2 +- .../admin/templates/admin/auth/user/change_password.html | 4 ++-- django/contrib/admin/templates/admin/change_form.html | 4 ++-- django/contrib/admin/templates/admin/change_list.html | 4 ++-- .../contrib/admin/templates/admin/delete_confirmation.html | 2 +- .../admin/templates/admin/delete_selected_confirmation.html | 4 ++-- django/contrib/admin/templates/admin/index.html | 4 ++-- django/contrib/admin/templates/admin/object_history.html | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py index 83a08699c2..42102e40f4 100644 --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -358,7 +358,7 @@ class AdminSite(object): app_dict[app_label]['models'].append(model_dict) else: app_dict[app_label] = { - 'name': app_label.title(), + 'name': app_label, 'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name), 'has_module_perms': has_module_perms, 'models': [model_dict], @@ -415,7 +415,7 @@ class AdminSite(object): # something to display, add in the necessary meta # information. app_dict = { - 'name': app_label.title(), + 'name': app_label, 'app_url': '', 'has_module_perms': has_module_perms, 'models': [model_dict], @@ -425,7 +425,7 @@ class AdminSite(object): # Sort the models alphabetically within each app. app_dict['models'].sort(key=lambda x: x['name']) context = { - 'title': _('%s administration') % capfirst(app_label), + 'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))}, 'app_list': [app_dict], } context.update(extra_context or {}) diff --git a/django/contrib/admin/templates/admin/app_index.html b/django/contrib/admin/templates/admin/app_index.html index 4616b16d3d..d41396a9fd 100644 --- a/django/contrib/admin/templates/admin/app_index.html +++ b/django/contrib/admin/templates/admin/app_index.html @@ -8,7 +8,7 @@ {% trans 'Home' %} › {% for app in app_list %} -{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %} +{% trans app.name|title %} {% endfor %} {% endblock %} diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html index 6adfaed548..a83cf063a0 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -13,8 +13,8 @@ {% block breadcrumbs %} diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index de442986ff..9ac8fddc01 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -19,8 +19,8 @@ {% block breadcrumbs %} {% endblock %} diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html index 98869cfa5c..222d22481b 100644 --- a/django/contrib/admin/templates/admin/change_list.html +++ b/django/contrib/admin/templates/admin/change_list.html @@ -41,8 +41,8 @@ {% block breadcrumbs %} {% endblock %} {% endif %} diff --git a/django/contrib/admin/templates/admin/delete_confirmation.html b/django/contrib/admin/templates/admin/delete_confirmation.html index 43440b2774..3af1ceff3e 100644 --- a/django/contrib/admin/templates/admin/delete_confirmation.html +++ b/django/contrib/admin/templates/admin/delete_confirmation.html @@ -6,7 +6,7 @@ {% block breadcrumbs %}