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
This commit is contained in:
Malcolm Tredinnick 2007-04-25 08:32:31 +00:00
parent 6c812e9143
commit d744a660c4
2 changed files with 5 additions and 4 deletions

View File

@ -108,6 +108,7 @@ answer newbie questions, and generally made Django that much better:
hipertracker@gmail.com hipertracker@gmail.com
Ian Holsman <http://feh.holsman.net/> Ian Holsman <http://feh.holsman.net/>
Kieran Holland <http://www.kieranholland.com> Kieran Holland <http://www.kieranholland.com>
Sung-Jin Hong <serialx.net@gmail.com>
Robert Rock Howard <http://djangomojo.com/> Robert Rock Howard <http://djangomojo.com/>
Jason Huggins <http://www.jrandolph.com/blog/> Jason Huggins <http://www.jrandolph.com/blog/>
Hyun Mi Ae Hyun Mi Ae

View File

@ -1,6 +1,6 @@
import datetime, math, time import datetime, math, time
from django.utils.tzinfo import LocalTimezone from django.utils.tzinfo import LocalTimezone
from django.utils.translation import ngettext from django.utils.translation import ngettext, gettext
def timesince(d, now=None): def timesince(d, now=None):
""" """
@ -37,14 +37,14 @@ def timesince(d, now=None):
if count != 0: if count != 0:
break break
if count < 0: if count < 0:
return '%d milliseconds' % math.floor((now - d).microseconds / 1000) return gettext('%d milliseconds') % math.floor((now - d).microseconds / 1000)
s = '%d %s' % (count, name(count)) s = gettext('%(number)d %(type)s') % {'number': count, 'type': name(count)}
if i + 1 < len(chunks): if i + 1 < len(chunks):
# Now get the second item # Now get the second item
seconds2, name2 = chunks[i + 1] seconds2, name2 = chunks[i + 1]
count2 = (since - (seconds * count)) / seconds2 count2 = (since - (seconds * count)) / seconds2
if count2 != 0: if count2 != 0:
s += ', %d %s' % (count2, name2(count2)) s += gettext(', %(number)d %(type)s') % {'number': count2, 'type': name2(count2)}
return s return s
def timeuntil(d, now=None): def timeuntil(d, now=None):