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

File 10436-app-name-translation-in-admin-r17377.diff, 8.3 KB (added by Ramiro Morales, 13 years ago)

Patch updated to trunk as of now

  • django/contrib/admin/sites.py

    diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
    a b  
    358358                        app_dict[app_label]['models'].append(model_dict)
    359359                    else:
    360360                        app_dict[app_label] = {
    361                             'name': app_label.title(),
     361                            'name': app_label,
    362362                            'app_url': reverse('admin:app_list', kwargs={'app_label': app_label}, current_app=self.name),
    363363                            'has_module_perms': has_module_perms,
    364364                            'models': [model_dict],
     
    415415                            # something to display, add in the necessary meta
    416416                            # information.
    417417                            app_dict = {
    418                                 'name': app_label.title(),
     418                                'name': app_label,
    419419                                'app_url': '',
    420420                                'has_module_perms': has_module_perms,
    421421                                'models': [model_dict],
     
    425425        # Sort the models alphabetically within each app.
    426426        app_dict['models'].sort(key=lambda x: x['name'])
    427427        context = {
    428             'title': _('%s administration') % capfirst(app_label),
     428            'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
    429429            'app_list': [app_dict],
    430430        }
    431431        context.update(extra_context or {})
  • django/contrib/admin/templates/admin/app_index.html

    diff --git a/django/contrib/admin/templates/admin/app_index.html b/django/contrib/admin/templates/admin/app_index.html
    a b  
    88<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
    99&rsaquo;
    1010{% for app in app_list %}
    11 {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
     11{% trans app.name|title %}
    1212{% endfor %}
    1313</div>
    1414{% endblock %}
  • django/contrib/admin/templates/admin/auth/user/change_password.html

    diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html
    a b  
    1313{% block breadcrumbs %}
    1414<div class="breadcrumbs">
    1515<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>
    1818&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a>
    1919&rsaquo; {% trans 'Change password' %}
    2020</div>
  • django/contrib/admin/templates/admin/change_form.html

    diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html
    a b  
    1919{% block breadcrumbs %}
    2020<div class="breadcrumbs">
    2121<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 %}
    2424&rsaquo; {% if add %}{% trans 'Add' %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
    2525</div>
    2626{% endblock %}
  • django/contrib/admin/templates/admin/change_list.html

    diff --git a/django/contrib/admin/templates/admin/change_list.html b/django/contrib/admin/templates/admin/change_list.html
    a b  
    4141{% block breadcrumbs %}
    4242<div class="breadcrumbs">
    4343<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 }}
    4646</div>
    4747{% endblock %}
    4848{% endif %}
  • django/contrib/admin/templates/admin/delete_confirmation.html

    diff --git a/django/contrib/admin/templates/admin/delete_confirmation.html b/django/contrib/admin/templates/admin/delete_confirmation.html
    a b  
    66{% block breadcrumbs %}
    77<div class="breadcrumbs">
    88<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>
    1010&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
    1111&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
    1212&rsaquo; {% trans 'Delete' %}
  • django/contrib/admin/templates/admin/delete_selected_confirmation.html

    diff --git a/django/contrib/admin/templates/admin/delete_selected_confirmation.html b/django/contrib/admin/templates/admin/delete_selected_confirmation.html
    a b  
    66{% block breadcrumbs %}
    77<div class="breadcrumbs">
    88<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>
    1111&rsaquo; {% trans 'Delete multiple objects' %}
    1212</div>
    1313{% endblock %}
  • django/contrib/admin/templates/admin/index.html

    diff --git a/django/contrib/admin/templates/admin/index.html b/django/contrib/admin/templates/admin/index.html
    a b  
    1515{% if app_list %}
    1616    {% for app in app_list %}
    1717        <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="Models available in the {% trans app.name|title %} application.">
     19        <caption><a href="{{ app.app_url }}" class="section">{% trans app.name|title %}</a></caption>
    2020        {% for model in app.models %}
    2121            <tr>
    2222            {% if model.admin_url %}
  • django/contrib/admin/templates/admin/object_history.html

    diff --git a/django/contrib/admin/templates/admin/object_history.html b/django/contrib/admin/templates/admin/object_history.html
    a b  
    66{% block breadcrumbs %}
    77<div class="breadcrumbs">
    88<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>
    1010&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
    1111&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
    1212&rsaquo; {% trans 'History' %}
Back to Top