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

Patch updated to trunk as of r11581

  • django/contrib/admin/sites.py

    diff -r 4d0e5fb0c33d django/contrib/admin/sites.py
    a b  
    349349                        app_dict[app_label]['models'].append(model_dict)
    350350                    else:
    351351                        app_dict[app_label] = {
    352                             'name': app_label.title(),
     352                            'name': _(app_label).title(),
    353353                            'app_url': app_label + '/',
    354354                            'has_module_perms': has_module_perms,
    355355                            'models': [model_dict],
     
    413413                            # something to display, add in the necessary meta
    414414                            # information.
    415415                            app_dict = {
    416                                 'name': app_label.title(),
     416                                'name': _(app_label).title(),
    417417                                'app_url': '',
    418418                                'has_module_perms': has_module_perms,
    419419                                'models': [model_dict],
     
    423423        # Sort the models alphabetically within each app.
    424424        app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
    425425        context = {
    426             'title': _('%s administration') % capfirst(app_label),
     426            'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
    427427            'app_list': [app_dict],
    428428            'root_path': self.root_path,
    429429        }
  • django/contrib/admin/templates/admin/app_index.html

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

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

    diff -r 4d0e5fb0c33d django/contrib/admin/templates/admin/change_list.html
    a b  
    2424      <a href="../../">
    2525        {% trans "Home" %}
    2626      </a>
    27        &rsaquo; 
     27       &rsaquo;
    2828       <a href="../">
    29          {{ app_label|capfirst }}
     29         {% filter capfirst %}{% trans app_label %}{% endfilter %}
    3030      </a>
    31       &rsaquo; 
     31      &rsaquo;
    3232      {{ cl.opts.verbose_name_plural|capfirst }}
    3333    </div>
    3434  {% endblock %}
     
    6767          </div>
    6868        {% endif %}
    6969      {% endblock %}
    70      
     70
    7171      <form action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
    7272      {% if cl.formset %}
    7373        {{ cl.formset.management_form }}
  • django/contrib/admin/templates/admin/delete_confirmation.html

    diff -r 4d0e5fb0c33d 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 4d0e5fb0c33d 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 4d0e5fb0c33d 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 4d0e5fb0c33d 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