Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4137 -- Added translation markup to a couple of missed strings…

…. Thanks,

Sung-Jin Hong.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5071 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit d744a660c4e1872370e40f77eb7a9e8d106aa73b 1 parent 6c812e9
Malcolm Tredinnick authored April 25, 2007
1  AUTHORS
@@ -108,6 +108,7 @@ answer newbie questions, and generally made Django that much better:
108 108
     hipertracker@gmail.com
109 109
     Ian Holsman <http://feh.holsman.net/>
110 110
     Kieran Holland <http://www.kieranholland.com>
  111
+    Sung-Jin Hong <serialx.net@gmail.com>
111 112
     Robert Rock Howard <http://djangomojo.com/>
112 113
     Jason Huggins <http://www.jrandolph.com/blog/>
113 114
     Hyun Mi Ae
8  django/utils/timesince.py
... ...
@@ -1,6 +1,6 @@
1 1
 import datetime, math, time
2 2
 from django.utils.tzinfo import LocalTimezone
3  
-from django.utils.translation import ngettext
  3
+from django.utils.translation import ngettext, gettext
4 4
 
5 5
 def timesince(d, now=None):
6 6
     """
@@ -37,14 +37,14 @@ def timesince(d, now=None):
37 37
         if count != 0:
38 38
             break
39 39
     if count < 0:
40  
-        return '%d milliseconds' % math.floor((now - d).microseconds / 1000)
41  
-    s = '%d %s' % (count, name(count))
  40
+        return gettext('%d milliseconds') % math.floor((now - d).microseconds / 1000)
  41
+    s = gettext('%(number)d %(type)s') % {'number': count, 'type': name(count)}
42 42
     if i + 1 < len(chunks):
43 43
         # Now get the second item
44 44
         seconds2, name2 = chunks[i + 1]
45 45
         count2 = (since - (seconds * count)) / seconds2
46 46
         if count2 != 0:
47  
-            s += ', %d %s' % (count2, name2(count2))
  47
+            s += gettext(', %(number)d %(type)s') % {'number': count2, 'type': name2(count2)}
48 48
     return s
49 49
 
50 50
 def timeuntil(d, now=None):

0 notes on commit d744a66

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