Changeset 5071
- Timestamp:
- 04/25/07 03:32:31 (1 year ago)
- Files:
-
- django/trunk/AUTHORS (modified) (1 diff)
- django/trunk/django/utils/timesince.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/AUTHORS
r5053 r5071 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/> django/trunk/django/utils/timesince.py
r3186 r5071 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): … … 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 … … 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
