Changeset 5061
- Timestamp:
- 04/23/07 00:51:29 (1 year ago)
- Files:
-
- django/trunk/django/contrib/auth/models.py (modified) (1 diff)
- django/trunk/django/template/defaultfilters.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/auth/models.py
r4985 r5061 274 274 275 275 def __str__(self): 276 return 'AnonymousUser'276 return _('AnonymousUser') 277 277 278 278 def __eq__(self, other): django/trunk/django/template/defaultfilters.py
r4699 r5061 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 … … 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'):
