Ticket #4137: django.util.timesince.i18n.patch.diff
File django.util.timesince.i18n.patch.diff, 919 bytes (added by , 18 years ago) |
---|
-
django/utils/timesince.py
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 _('%d milliseconds') % math.floor((now - d).microseconds / 1000) 41 s = _('%(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 += _(', %(number)d %(type)s') % {'number':count2, 'type':name2(count2)} 48 48 return s 49 49 50 50 def timeuntil(d, now=None):