Ticket #4107: diff.2.diff
File diff.2.diff, 3.0 KB (added by , 18 years ago) |
---|
-
contrib/auth/models.py
258 258 pass 259 259 260 260 def __str__(self): 261 return 'AnonymousUser'261 return _('AnonymousUser') 262 262 263 263 def __eq__(self, other): 264 264 return isinstance(other, self.__class__) -
contrib/admindocs/views.py
168 168 model = m 169 169 break 170 170 if model is None: 171 raise Http404, _("Model % r not found in app %r") % (model_name, app_label)171 raise Http404, _("Model %(name)r not found in app %(app)r") % {'name': model_name, 'app': app_label} 172 172 173 173 opts = model._meta 174 174 … … 180 180 if isinstance(field, models.ForeignKey): 181 181 data_type = related_object_name = field.rel.to.__name__ 182 182 app_label = field.rel.to._meta.app_label 183 verbose = utils.parse_rst((_("the related `% s.%s` object") % (app_label, data_type)), 'model', _('model:') + data_type)183 verbose = utils.parse_rst((_("the related `%(app)s.%(type)s` object") % {'app': app_label, 'type': data_type}), 'model', _('model:') + data_type) 184 184 else: 185 185 data_type = get_readable_field_data_type(field) 186 186 verbose = field.verbose_name … … 211 211 212 212 # Gather related objects 213 213 for rel in opts.get_all_related_objects(): 214 verbose = _("related `% s.%s` objects") % (rel.opts.app_label, rel.opts.object_name)214 verbose = _("related `%(app)s.%(name)s` objects") % {'app': rel.opts.app_label, 'name': rel.opts.object_name} 215 215 accessor = rel.get_accessor_name() 216 216 fields.append({ 217 217 'name' : "%s.all" % accessor, -
template/defaultfilters.py
2 2 3 3 from django.template import resolve_variable, Library 4 4 from django.conf import settings 5 from django.utils.translation import gettext 5 from django.utils.translation import gettext, ngettext 6 6 import re 7 7 import random as random_module 8 8 … … 517 517 return "0 bytes" 518 518 519 519 if bytes < 1024: 520 return "%d byte%s" % (bytes, bytes != 1 and 's' or '')520 return ngettext("%(size)d byte", "%(size)d bytes", bytes) % {'size': bytes} 521 521 if bytes < 1024 * 1024: 522 return "%.1f KB"% (bytes / 1024)522 return gettext("%.1f KB") % (bytes / 1024) 523 523 if bytes < 1024 * 1024 * 1024: 524 return "%.1f MB"% (bytes / (1024 * 1024))525 return "%.1f GB"% (bytes / (1024 * 1024 * 1024))524 return gettext("%.1f MB") % (bytes / (1024 * 1024)) 525 return gettext("%.1f GB") % (bytes / (1024 * 1024 * 1024)) 526 526 527 527 def pluralize(value, arg='s'): 528 528 """