Code

Ticket #10436: 10436-app-name-translation-in-admin-r11581.diff

File 10436-app-name-translation-in-admin-r11581.diff, 7.9 KB (added by ramiro, 5 years ago)

Patch updated to trunk as of r11581

Line 
1diff -r 4d0e5fb0c33d django/contrib/admin/sites.py
2--- a/django/contrib/admin/sites.py     Wed Sep 16 09:09:47 2009 -0300
3+++ b/django/contrib/admin/sites.py     Thu Sep 17 19:47:14 2009 -0300
4@@ -349,7 +349,7 @@
5                         app_dict[app_label]['models'].append(model_dict)
6                     else:
7                         app_dict[app_label] = {
8-                            'name': app_label.title(),
9+                            'name': _(app_label).title(),
10                             'app_url': app_label + '/',
11                             'has_module_perms': has_module_perms,
12                             'models': [model_dict],
13@@ -413,7 +413,7 @@
14                             # something to display, add in the necessary meta
15                             # information.
16                             app_dict = {
17-                                'name': app_label.title(),
18+                                'name': _(app_label).title(),
19                                 'app_url': '',
20                                 'has_module_perms': has_module_perms,
21                                 'models': [model_dict],
22@@ -423,7 +423,7 @@
23         # Sort the models alphabetically within each app.
24         app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
25         context = {
26-            'title': _('%s administration') % capfirst(app_label),
27+            'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
28             'app_list': [app_dict],
29             'root_path': self.root_path,
30         }
31diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/app_index.html
32--- a/django/contrib/admin/templates/admin/app_index.html       Wed Sep 16 09:09:47 2009 -0300
33+++ b/django/contrib/admin/templates/admin/app_index.html       Thu Sep 17 19:47:14 2009 -0300
34@@ -7,7 +7,7 @@
35 <div class="breadcrumbs"><a href="../">
36 {% trans "Home" %}</a> &rsaquo;
37 {% for app in app_list %}
38-{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
39+{{ app.name }}
40 {% endfor %}</div>{% endblock %}
41 
42 {% endif %}
43diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/auth/user/change_password.html
44--- a/django/contrib/admin/templates/admin/auth/user/change_password.html       Wed Sep 16 09:09:47 2009 -0300
45+++ b/django/contrib/admin/templates/admin/auth/user/change_password.html       Thu Sep 17 19:47:14 2009 -0300
46@@ -8,7 +8,7 @@
47 {% block breadcrumbs %}{% if not is_popup %}
48 <div class="breadcrumbs">
49      <a href="../../../../">{% trans "Home" %}</a> &rsaquo;
50-     <a href="../../../">{{ opts.app_label|capfirst|escape }}</a> &rsaquo;
51+     <a href="../../../">{% filter capfirst %}{% trans opts.app_label %}{% endfilter %}</a> &rsaquo;
52      <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
53      <a href="../">{{ original|truncatewords:"18" }}</a> &rsaquo;
54      {% trans 'Change password' %}
55diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/change_form.html
56--- a/django/contrib/admin/templates/admin/change_form.html     Wed Sep 16 09:09:47 2009 -0300
57+++ b/django/contrib/admin/templates/admin/change_form.html     Thu Sep 17 19:47:14 2009 -0300
58@@ -15,8 +15,8 @@
59 {% block breadcrumbs %}{% if not is_popup %}
60 <div class="breadcrumbs">
61      <a href="../../../">{% trans "Home" %}</a> &rsaquo;
62-     <a href="../../">{{ app_label|capfirst|escape }}</a> &rsaquo;
63-     {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} &rsaquo;
64+     <a href="../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
65+     {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} &rsaquo;
66      {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
67 </div>
68 {% endif %}{% endblock %}
69diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/change_list.html
70--- a/django/contrib/admin/templates/admin/change_list.html     Wed Sep 16 09:09:47 2009 -0300
71+++ b/django/contrib/admin/templates/admin/change_list.html     Thu Sep 17 19:47:14 2009 -0300
72@@ -24,11 +24,11 @@
73       <a href="../../">
74         {% trans "Home" %}
75       </a>
76-       &rsaquo;
77+       &rsaquo;
78        <a href="../">
79-         {{ app_label|capfirst }}
80+         {% filter capfirst %}{% trans app_label %}{% endfilter %}
81       </a>
82-      &rsaquo;
83+      &rsaquo;
84       {{ cl.opts.verbose_name_plural|capfirst }}
85     </div>
86   {% endblock %}
87@@ -67,7 +67,7 @@
88           </div>
89         {% endif %}
90       {% endblock %}
91-     
92+
93       <form action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
94       {% if cl.formset %}
95         {{ cl.formset.management_form }}
96diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/delete_confirmation.html
97--- a/django/contrib/admin/templates/admin/delete_confirmation.html     Wed Sep 16 09:09:47 2009 -0300
98+++ b/django/contrib/admin/templates/admin/delete_confirmation.html     Thu Sep 17 19:47:14 2009 -0300
99@@ -4,7 +4,7 @@
100 {% block breadcrumbs %}
101 <div class="breadcrumbs">
102      <a href="../../../../">{% trans "Home" %}</a> &rsaquo;
103-     <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo;
104+     <a href="../../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
105      <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
106      <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
107      {% trans 'Delete' %}
108diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/delete_selected_confirmation.html
109--- a/django/contrib/admin/templates/admin/delete_selected_confirmation.html    Wed Sep 16 09:09:47 2009 -0300
110+++ b/django/contrib/admin/templates/admin/delete_selected_confirmation.html    Thu Sep 17 19:47:14 2009 -0300
111@@ -4,7 +4,7 @@
112 {% block breadcrumbs %}
113 <div class="breadcrumbs">
114      <a href="../../">{% trans "Home" %}</a> &rsaquo;
115-     <a href="../">{{ app_label|capfirst }}</a> &rsaquo;
116+     <a href="../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
117      <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
118      {% trans 'Delete multiple objects' %}
119 </div>
120diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/index.html
121--- a/django/contrib/admin/templates/admin/index.html   Wed Sep 16 09:09:47 2009 -0300
122+++ b/django/contrib/admin/templates/admin/index.html   Thu Sep 17 19:47:14 2009 -0300
123@@ -15,8 +15,8 @@
124 {% if app_list %}
125     {% for app in app_list %}
126         <div class="module">
127-        <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
128-        <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption>
129+        <table summary="Models available in the {% trans app.name %} application.">
130+        <caption><a href="{{ app.app_url }}" class="section">{{ app.name }}</a></caption>
131         {% for model in app.models %}
132             <tr>
133             {% if model.perms.change %}
134diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/object_history.html
135--- a/django/contrib/admin/templates/admin/object_history.html  Wed Sep 16 09:09:47 2009 -0300
136+++ b/django/contrib/admin/templates/admin/object_history.html  Thu Sep 17 19:47:14 2009 -0300
137@@ -3,10 +3,10 @@
138 
139 {% block breadcrumbs %}
140 <div class="breadcrumbs">
141-    <a href="../../../../">{% trans 'Home' %}</a> &rsaquo;
142-    <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo;
143-    <a href="../../">{{ module_name }}</a> &rsaquo;
144-    <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
145+    <a href="../../../../">{% trans 'Home' %}</a> &rsaquo;
146+    <a href="../../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
147+    <a href="../../">{{ module_name }}</a> &rsaquo;
148+    <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
149     {% trans 'History' %}
150 </div>
151 {% endblock %}