summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-04-23 05:51:29 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-04-23 05:51:29 +0000
commit00cb6a1ba81711c6fc361a3fc0498685bf3953e8 (patch)
treef984d279a3a264f2de8d6c26fe2d806e3dcfc567
parent254e087e31a38c7dc2cf91c062e62addcf409570 (diff)
Fixed #4107 -- Marked a few more strings for translation. Thanks, Baptiste.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/auth/models.py2
-rw-r--r--django/template/defaultfilters.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py
index f686d90e7a..6fe781a041 100644
--- a/django/contrib/auth/models.py
+++ b/django/contrib/auth/models.py
@@ -273,7 +273,7 @@ class AnonymousUser(object):
pass
def __str__(self):
- return 'AnonymousUser'
+ return _('AnonymousUser')
def __eq__(self, other):
return isinstance(other, self.__class__)
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py
index a025365c90..bbaceba24a 100644
--- a/django/template/defaultfilters.py
+++ b/django/template/defaultfilters.py
@@ -2,7 +2,7 @@
from django.template import resolve_variable, Library
from django.conf import settings
-from django.utils.translation import gettext
+from django.utils.translation import gettext, ngettext
import re
import random as random_module
@@ -517,12 +517,12 @@ def filesizeformat(bytes):
return "0 bytes"
if bytes < 1024:
- return "%d byte%s" % (bytes, bytes != 1 and 's' or '')
+ return ngettext("%(size)d byte", "%(size)d bytes", bytes) % {'size': bytes}
if bytes < 1024 * 1024:
- return "%.1f KB" % (bytes / 1024)
+ return gettext("%.1f KB") % (bytes / 1024)
if bytes < 1024 * 1024 * 1024:
- return "%.1f MB" % (bytes / (1024 * 1024))
- return "%.1f GB" % (bytes / (1024 * 1024 * 1024))
+ return gettext("%.1f MB") % (bytes / (1024 * 1024))
+ return gettext("%.1f GB") % (bytes / (1024 * 1024 * 1024))
def pluralize(value, arg='s'):
"""