Code

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

File 10436-app-name-translation-in-admin-r12157.diff, 7.5 KB (added by ramiro, 4 years ago)

Patch updated to r12157

Line 
1diff -r 0d9ec80400cb django/contrib/admin/sites.py
2--- a/django/contrib/admin/sites.py     Sun Jan 10 00:36:59 2010 -0300
3+++ b/django/contrib/admin/sites.py     Sun Jan 10 12:31:12 2010 -0300
4@@ -356,7 +356,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@@ -420,7 +420,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@@ -430,7 +430,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 0d9ec80400cb django/contrib/admin/templates/admin/app_index.html
32--- a/django/contrib/admin/templates/admin/app_index.html       Sun Jan 10 00:36:59 2010 -0300
33+++ b/django/contrib/admin/templates/admin/app_index.html       Sun Jan 10 12:31:12 2010 -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 0d9ec80400cb django/contrib/admin/templates/admin/auth/user/change_password.html
44--- a/django/contrib/admin/templates/admin/auth/user/change_password.html       Sun Jan 10 00:36:59 2010 -0300
45+++ b/django/contrib/admin/templates/admin/auth/user/change_password.html       Sun Jan 10 12:31:12 2010 -0300
46@@ -9,7 +9,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 0d9ec80400cb django/contrib/admin/templates/admin/change_form.html
56--- a/django/contrib/admin/templates/admin/change_form.html     Sun Jan 10 00:36:59 2010 -0300
57+++ b/django/contrib/admin/templates/admin/change_form.html     Sun Jan 10 12:31:12 2010 -0300
58@@ -16,8 +16,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 0d9ec80400cb django/contrib/admin/templates/admin/change_list.html
70--- a/django/contrib/admin/templates/admin/change_list.html     Sun Jan 10 00:36:59 2010 -0300
71+++ b/django/contrib/admin/templates/admin/change_list.html     Sun Jan 10 12:31:12 2010 -0300
72@@ -27,7 +27,7 @@
73       </a>
74        &rsaquo;
75        <a href="../">
76-         {{ app_label|capfirst }}
77+         {% filter capfirst %}{% trans app_label %}{% endfilter %}
78       </a>
79       &rsaquo;
80       {{ cl.opts.verbose_name_plural|capfirst }}
81diff -r 0d9ec80400cb django/contrib/admin/templates/admin/delete_confirmation.html
82--- a/django/contrib/admin/templates/admin/delete_confirmation.html     Sun Jan 10 00:36:59 2010 -0300
83+++ b/django/contrib/admin/templates/admin/delete_confirmation.html     Sun Jan 10 12:31:12 2010 -0300
84@@ -4,7 +4,7 @@
85 {% block breadcrumbs %}
86 <div class="breadcrumbs">
87      <a href="../../../../">{% trans "Home" %}</a> &rsaquo;
88-     <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo;
89+     <a href="../../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
90      <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
91      <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
92      {% trans 'Delete' %}
93diff -r 0d9ec80400cb django/contrib/admin/templates/admin/delete_selected_confirmation.html
94--- a/django/contrib/admin/templates/admin/delete_selected_confirmation.html    Sun Jan 10 00:36:59 2010 -0300
95+++ b/django/contrib/admin/templates/admin/delete_selected_confirmation.html    Sun Jan 10 12:31:12 2010 -0300
96@@ -4,7 +4,7 @@
97 {% block breadcrumbs %}
98 <div class="breadcrumbs">
99      <a href="../../">{% trans "Home" %}</a> &rsaquo;
100-     <a href="../">{{ app_label|capfirst }}</a> &rsaquo;
101+     <a href="../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
102      <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
103      {% trans 'Delete multiple objects' %}
104 </div>
105diff -r 0d9ec80400cb django/contrib/admin/templates/admin/index.html
106--- a/django/contrib/admin/templates/admin/index.html   Sun Jan 10 00:36:59 2010 -0300
107+++ b/django/contrib/admin/templates/admin/index.html   Sun Jan 10 12:31:12 2010 -0300
108@@ -15,8 +15,8 @@
109 {% if app_list %}
110     {% for app in app_list %}
111         <div class="module">
112-        <table summary="{% blocktrans with app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
113-        <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption>
114+        <table summary="Models available in the {% trans app.name %} application.">
115+        <caption><a href="{{ app.app_url }}" class="section">{{ app.name }}</a></caption>
116         {% for model in app.models %}
117             <tr>
118             {% if model.perms.change %}
119diff -r 0d9ec80400cb django/contrib/admin/templates/admin/object_history.html
120--- a/django/contrib/admin/templates/admin/object_history.html  Sun Jan 10 00:36:59 2010 -0300
121+++ b/django/contrib/admin/templates/admin/object_history.html  Sun Jan 10 12:31:12 2010 -0300
122@@ -3,10 +3,10 @@
123 
124 {% block breadcrumbs %}
125 <div class="breadcrumbs">
126-    <a href="../../../../">{% trans 'Home' %}</a> &rsaquo;
127-    <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo;
128-    <a href="../../">{{ module_name }}</a> &rsaquo;
129-    <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
130+    <a href="../../../../">{% trans 'Home' %}</a> &rsaquo;
131+    <a href="../../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
132+    <a href="../../">{{ module_name }}</a> &rsaquo;
133+    <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
134     {% trans 'History' %}
135 </div>
136 {% endblock %}