Reverted [17378] until a public API is available for application labels.

This will allow to solve the i18n of such labels in a more holistic way
without the need to introduce temporary, undocumented mechanisms to
translate them.

Refs #3591, #10436

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17389 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales 2012-01-23 16:17:47 +00:00
parent 7beb0db79b
commit 752a43e245
9 changed files with 16 additions and 16 deletions

View File

@ -358,7 +358,7 @@ class AdminSite(object):
app_dict[app_label]['models'].append(model_dict) app_dict[app_label]['models'].append(model_dict)
else: else:
app_dict[app_label] = { app_dict[app_label] = {
'name': app_label, 'name': app_label.title(),
'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name), 'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name),
'has_module_perms': has_module_perms, 'has_module_perms': has_module_perms,
'models': [model_dict], 'models': [model_dict],
@ -415,7 +415,7 @@ class AdminSite(object):
# something to display, add in the necessary meta # something to display, add in the necessary meta
# information. # information.
app_dict = { app_dict = {
'name': app_label, 'name': app_label.title(),
'app_url': '', 'app_url': '',
'has_module_perms': has_module_perms, 'has_module_perms': has_module_perms,
'models': [model_dict], 'models': [model_dict],
@ -425,7 +425,7 @@ class AdminSite(object):
# Sort the models alphabetically within each app. # Sort the models alphabetically within each app.
app_dict['models'].sort(key=lambda x: x['name']) app_dict['models'].sort(key=lambda x: x['name'])
context = { context = {
'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))}, 'title': _('%s administration') % capfirst(app_label),
'app_list': [app_dict], 'app_list': [app_dict],
} }
context.update(extra_context or {}) context.update(extra_context or {})

View File

@ -8,7 +8,7 @@
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; &rsaquo;
{% for app in app_list %} {% for app in app_list %}
{% trans app.name|title %} {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -13,8 +13,8 @@
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans opts.app_label|capfirst|escape %}</a> &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_label|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a> &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a> &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a>
&rsaquo; {% trans 'Change password' %} &rsaquo; {% trans 'Change password' %}
</div> </div>

View File

@ -19,8 +19,8 @@
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans app_label|capfirst|escape %}</a> &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst|escape }}</a>
&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 %} &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 %}
&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %} &rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -41,8 +41,8 @@
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{% trans app_label|capfirst|escape %}</a> &rsaquo; <a href="{% url 'admin:app_list' app_label=cl.opts.app_label %}">{{ app_label|capfirst|escape }}</a>
&rsaquo; {{ cl.opts.verbose_name_plural|capfirst|escape }} &rsaquo; {{ cl.opts.verbose_name_plural|capfirst }}
</div> </div>
{% endblock %} {% endblock %}
{% endif %} {% endif %}

View File

@ -6,7 +6,7 @@
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{% trans app_label|capfirst|escape %}</a> &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a> &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a> &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% trans 'Delete' %} &rsaquo; {% trans 'Delete' %}

View File

@ -6,8 +6,8 @@
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{% trans app_label|capfirst|escape %}</a> &rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a> &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; {% trans 'Delete multiple objects' %} &rsaquo; {% trans 'Delete multiple objects' %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -15,8 +15,8 @@
{% if app_list %} {% if app_list %}
{% for app in app_list %} {% for app in app_list %}
<div class="module"> <div class="module">
<table summary="{% blocktrans with name=app.name|title %}Models available in the {{ name }} application.{% endblocktrans %}"> <table summary="{% blocktrans with name=app.name %}Models available in the {{ name }} application.{% endblocktrans %}">
<caption><a href="{{ app.app_url }}" class="section">{% trans app.name|title %}</a></caption> <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with name=app.name %}{{ name }}{% endblocktrans %}</a></caption>
{% for model in app.models %} {% for model in app.models %}
<tr> <tr>
{% if model.admin_url %} {% if model.admin_url %}

View File

@ -6,7 +6,7 @@
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{% trans app_label|capfirst|escape %}</a> &rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a> &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a> &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
&rsaquo; {% trans 'History' %} &rsaquo; {% trans 'History' %}