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

File 10436-app-name-translation-in-admin-r10283.diff, 8.0 KB (added by Ramiro Morales, 16 years ago)

Patch updated to trunk post-bulk-edit and post-r10234

  • django/contrib/admin/sites.py

    diff -r f44ec14ec084 django/contrib/admin/sites.py
    a b  
    318318                        app_dict[app_label]['models'].append(model_dict)
    319319                    else:
    320320                        app_dict[app_label] = {
    321                             'name': app_label.title(),
     321                            'name': _(app_label).title(),
    322322                            'app_url': app_label + '/',
    323323                            'has_module_perms': has_module_perms,
    324324                            'models': [model_dict],
     
    383383                            # something to display, add in the necessary meta
    384384                            # information.
    385385                            app_dict = {
    386                                 'name': app_label.title(),
     386                                'name': _(app_label).title(),
    387387                                'app_url': '',
    388388                                'has_module_perms': has_module_perms,
    389389                                'models': [model_dict],
     
    393393        # Sort the models alphabetically within each app.
    394394        app_dict['models'].sort(lambda x, y: cmp(x['name'], y['name']))
    395395        context = {
    396             'title': _('%s administration') % capfirst(app_label),
     396            'title': _('%(app_label)s administration') % {'app_label': capfirst(_(app_label))},
    397397            'app_list': [app_dict],
    398398            'root_path': self.root_path,
    399399        }
  • django/contrib/admin/templates/admin/app_index.html

    diff -r f44ec14ec084 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 f44ec14ec084 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 f44ec14ec084 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 f44ec14ec084 django/contrib/admin/templates/admin/change_list.html
    a b  
    1919      <a href="../../">
    2020        {% trans "Home" %}
    2121      </a>
    22        &rsaquo; 
     22       &rsaquo;
    2323       <a href="../">
    24          {{ app_label|capfirst }}
     24         {% filter capfirst %}{% trans app_label %}{% endfilter %}
    2525      </a>
    26       &rsaquo; 
     26      &rsaquo;
    2727      {{ cl.opts.verbose_name_plural|capfirst }}
    2828    </div>
    2929  {% endblock %}
     
    6262          </div>
    6363        {% endif %}
    6464      {% endblock %}
    65      
     65
    6666      <form action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>
    6767      {% if cl.formset %}
    6868        {{ cl.formset.management_form }}
  • django/contrib/admin/templates/admin/delete_confirmation.html

    diff -r f44ec14ec084 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 f44ec14ec084 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>
     
    3434    </div>
    3535    </form>
    3636{% endif %}
    37 {% endblock %}
    38  No newline at end of file
     37{% endblock %}
  • django/contrib/admin/templates/admin/index.html

    diff -r f44ec14ec084 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 f44ec14ec084 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