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

File 10436-app-name-translation-in-admin-r12676.diff, 6.8 KB (added by ramiro, 5 years ago)

Patch updated to r12676 simplify fixes taing in account fixed made in r12472.

  • django/contrib/admin/sites.py

    diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
    a b  
    375375                        app_dict[app_label]['models'].append(model_dict)
    376376                    else:
    377377                        app_dict[app_label] = {
    378                             'name': app_label.title(),
     378                            'name': _(app_label).title(),
    379379                            'app_url': app_label + '/',
    380380                            'has_module_perms': has_module_perms,
    381381                            'models': [model_dict],
     
    439439                            # something to display, add in the necessary meta
    440440                            # information.
    441441                            app_dict = {
    442                                 'name': app_label.title(),
     442                                'name': _(app_label).title(),
    443443                                'app_url': '',
    444444                                'has_module_perms': has_module_perms,
    445445                                'models': [model_dict],
     
    449449        # Sort the models alphabetically within each app.
    450450        app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
    451451        context = {
    452             'title': _('%s administration') % capfirst(app_label),
     452            'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
    453453            'app_list': [app_dict],
    454454            'root_path': self.root_path,
    455455        }
  • 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  
    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 --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  
    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="../../../">{% trans opts.app_label|capfirst %}</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 --git a/django/contrib/admin/templates/admin/change_form.html b/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;
     19     <a href="../../">{% trans app_label|capfirst %}</a> &rsaquo;
    2020     {% 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>
  • 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  
    4040      </a>
    4141       &rsaquo;
    4242       <a href="../">
    43          {{ app_label|capfirst }}
     43         {% trans app_label|capfirst %}
    4444      </a>
    4545      &rsaquo;
    4646      {{ cl.opts.verbose_name_plural|capfirst }}
  • 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  
    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="../../../">{% trans app_label|capfirst %}</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 --git a/django/contrib/admin/templates/admin/delete_selected_confirmation.html b/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="../">{% trans app_label|capfirst %}</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 --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 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 {{ 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 --git a/django/contrib/admin/templates/admin/object_history.html b/django/contrib/admin/templates/admin/object_history.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="../../../">{% trans app_label|capfirst %}</a> &rsaquo;
    88    <a href="../../">{{ module_name }}</a> &rsaquo;
    99    <a href="../">{{ object|truncatewords:"18" }}</a> &rsaquo;
    1010    {% trans 'History' %}
Back to Top