Ticket #5401: newforms-admin-translations.diff

File newforms-admin-translations.diff, 1.6 KB (added by Petr Marhoun <petr.marhoun@…>, 17 years ago)
  • django/contrib/admindocs/views.py

    === modified file 'django/contrib/admindocs/views.py'
     
    169169            model = m
    170170            break
    171171    if model is None:
    172         raise Http404, _("Model %r not found in app %r") % (model_name, app_label)
     172        raise Http404, _("Model %(model_name)r not found in app %(app_label)r") % {'model_name': model_name, 'app_label': app_label}
    173173
    174174    opts = model._meta
    175175
     
    181181        if isinstance(field, models.ForeignKey):
    182182            data_type = related_object_name = field.rel.to.__name__
    183183            app_label = field.rel.to._meta.app_label
    184             verbose = utils.parse_rst((_("the related `%s.%s` object")  % (app_label, data_type)), 'model', _('model:') + data_type)
     184            verbose = utils.parse_rst((_("the related `%(app_label)s.%(data_type)s` object")  % {'app_label': app_label, 'data_type': data_type}), 'model', _('model:') + data_type)
    185185        else:
    186186            data_type = get_readable_field_data_type(field)
    187187            verbose = field.verbose_name
     
    212212
    213213    # Gather related objects
    214214    for rel in opts.get_all_related_objects():
    215         verbose = _("related `%s.%s` objects") % (rel.opts.app_label, rel.opts.object_name)
     215        verbose = _("related `%(app_label)s.%(object_name)s` objects") % {'app_label': rel.opts.app_label, 'object_name': rel.opts.object_name}
    216216        accessor = rel.get_accessor_name()
    217217        fields.append({
    218218            'name'      : "%s.all" % accessor,
Back to Top