Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Malcolm Tredinnick authored April 23, 2007
2  django/contrib/auth/models.py
@@ -273,7 +273,7 @@ def __init__(self):
273 273
         pass
274 274
 
275 275
     def __str__(self):
276  
-        return 'AnonymousUser'
  276
+        return _('AnonymousUser')
277 277
 
278 278
     def __eq__(self, other):
279 279
         return isinstance(other, self.__class__)
10  django/template/defaultfilters.py
@@ -2,7 +2,7 @@
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,12 +517,12 @@ def filesizeformat(bytes):
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
     """

0 notes on commit 00cb6a1

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