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, 5 years ago)

Patch updated to r12157

  • django/contrib/admin/sites.py

    diff -r 0d9ec80400cb django/contrib/admin/sites.py
    a b  
    356356                        app_dict[app_label]['models'].append(model_dict)
    357357                    else:
    358358                        app_dict[app_label] = {
    359                             'name': app_label.title(),
     359                            'name': _(app_label).title(),
    360360                            'app_url': app_label + '/',
    361361                            'has_module_perms': has_module_perms,
    362362                            'models': [model_dict],
     
    420420                            # something to display, add in the necessary meta
    421421                            # information.
    422422                            app_dict = {
    423                                 'name': app_label.title(),
     423                                'name': _(app_label).title(),
    424424                                'app_url': '',
    425425                                'has_module_perms': has_module_perms,
    426426                                'models': [model_dict],
     
    430430        # Sort the models alphabetically within each app.
    431431        app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
    432432        context = {
    433             'title': _('%s administration') % capfirst(app_label),
     433            'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
    434434            'app_list': [app_dict],
    435435            'root_path': self.root_path,
    436436        }
  • django/contrib/admin/templates/admin/app_index.html

    diff -r 0d9ec80400cb django/contrib/admin/templates/admin/app_index.html
    a b  
    77<div class="breadcrumbs"><a href="../">
    88{% trans "Home" %}</a> &rsaquo;
    99{% for app in app_list %}
    10 {% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}
     10{{ app.name }}
    1111{% endfor %}</div>{% endblock %}
    1212
    1313{% endif %}
  • django/contrib/admin/templates/admin/auth/user/change_password.html

    diff -r 0d9ec80400cb django/contrib/admin/templates/admin/auth/user/change_password.html
    a b  
    99{% block breadcrumbs %}{% if not is_popup %}
    1010<div class="breadcrumbs">
    1111     <a href="../../../../">{% trans "Home" %}</a> &rsaquo;
    12      <a href="../../../">{{ opts.app_label|capfirst|escape }}</a> &rsaquo;
     12     <a href="../../../">{% filter capfirst %}{% trans opts.app_label %}{% endfilter %}</a> &rsaquo;
    1313     <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
    1414     <a href="../">{{ original|truncatewords:"18" }}</a> &rsaquo;
    1515     {% trans 'Change password' %}
  • django/contrib/admin/templates/admin/change_form.html

    diff -r 0d9ec80400cb django/contrib/admin/templates/admin/change_form.html
    a b  
    1616{% block breadcrumbs %}{% if not is_popup %}
    1717<div class="breadcrumbs">
    1818     <a href="../../../">{% trans "Home" %}</a> &rsaquo;
    19      <a href="../../">{{ app_label|capfirst|escape }}</a> &rsaquo;
    20      {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} &rsaquo; 
     19     <a href="../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
     20     {% if has_change_permission %}<a href="../">{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} &rsaquo;
    2121     {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}{{ original|truncatewords:"18" }}{% endif %}
    2222</div>
    2323{% endif %}{% endblock %}
  • django/contrib/admin/templates/admin/change_list.html

    diff -r 0d9ec80400cb django/contrib/admin/templates/admin/change_list.html
    a b  
    2727      </a>
    2828       &rsaquo;
    2929       <a href="../">
    30          {{ app_label|capfirst }}
     30         {% filter capfirst %}{% trans app_label %}{% endfilter %}
    3131      </a>
    3232      &rsaquo;
    3333      {{ cl.opts.verbose_name_plural|capfirst }}
  • django/contrib/admin/templates/admin/delete_confirmation.html

    diff -r 0d9ec80400cb django/contrib/admin/templates/admin/delete_confirmation.html
    a b  
    44{% block breadcrumbs %}
    55<div class="breadcrumbs">
    66     <a href="../../../../">{% trans "Home" %}</a> &rsaquo;
    7      <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo;
     7     <a href="../../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
    88     <a href="../../">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
    99     <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
    1010     {% trans 'Delete' %}
  • django/contrib/admin/templates/admin/delete_selected_confirmation.html

    diff -r 0d9ec80400cb django/contrib/admin/templates/admin/delete_selected_confirmation.html
    a b  
    44{% block breadcrumbs %}
    55<div class="breadcrumbs">
    66     <a href="../../">{% trans "Home" %}</a> &rsaquo;
    7      <a href="../">{{ app_label|capfirst }}</a> &rsaquo;
     7     <a href="../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
    88     <a href="./">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
    99     {% trans 'Delete multiple objects' %}
    1010</div>
  • django/contrib/admin/templates/admin/index.html

    diff -r 0d9ec80400cb 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 app.name as name %}Models available in the {{ name }} application.{% endblocktrans %}">
    19         <caption><a href="{{ app.app_url }}" class="section">{% blocktrans with app.name as name %}{{ name }}{% endblocktrans %}</a></caption>
     18        <table summary="Models available in the {% trans app.name %} application.">
     19        <caption><a href="{{ app.app_url }}" class="section">{{ app.name }}</a></caption>
    2020        {% for model in app.models %}
    2121            <tr>
    2222            {% if model.perms.change %}
  • django/contrib/admin/templates/admin/object_history.html

    diff -r 0d9ec80400cb django/contrib/admin/templates/admin/object_history.html
    a b  
    33
    44{% block breadcrumbs %}
    55<div class="breadcrumbs">
    6     <a href="../../../../">{% trans 'Home' %}</a> &rsaquo; 
    7     <a href="../../../">{{ app_label|capfirst }}</a> &rsaquo;
    8     <a href="../../">{{ module_name }}</a> &rsaquo; 
    9     <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo; 
     6    <a href="../../../../">{% trans 'Home' %}</a> &rsaquo;
     7    <a href="../../../">{% filter capfirst %}{% trans app_label %}{% endfilter %}</a> &rsaquo;
     8    <a href="../../">{{ module_name }}</a> &rsaquo;
     9    <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
    1010    {% trans 'History' %}
    1111</div>
    1212{% endblock %}
Back to Top