Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #4107 -- Marked a few more strings for translation. Thanks, Bap…

…tiste.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 00cb6a1ba81711c6fc361a3fc0498685bf3953e8 1 parent 254e087
@malcolmt malcolmt authored
View
2  django/contrib/auth/models.py
@@ -273,7 +273,7 @@ def __init__(self):
pass
def __str__(self):
- return 'AnonymousUser'
+ return _('AnonymousUser')
def __eq__(self, other):
return isinstance(other, self.__class__)
View
10 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'):
"""

0 comments on commit 00cb6a1

Please sign in to comment.
Something went wrong with that request. Please try again.