Fixed #15981 -- Use ungettext instead of manually checking for plurals. Thanks, gasperzejn.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel 2011-05-07 19:55:51 +00:00
parent 385ae343fb
commit 688abe3b8d
3 changed files with 38 additions and 44 deletions

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-05-06 14:14+0200\n"
"POT-Creation-Date: 2011-05-07 21:53+0200\n"
"PO-Revision-Date: 2010-05-13 15:35+0200\n"
"Last-Translator: Django team\n"
"Language-Team: English <en@li.org>\n"
@ -28,119 +28,117 @@ msgstr ""
msgid "rd"
msgstr ""
#: templatetags/humanize.py:68
#: templatetags/humanize.py:74
#, python-format
msgid "%(value).1f million"
msgid_plural "%(value).1f million"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:69
#: templatetags/humanize.py:75
#, python-format
msgid "%(value)s million"
msgid_plural "%(value)s million"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:74
#: templatetags/humanize.py:80
#, python-format
msgid "%(value).1f billion"
msgid_plural "%(value).1f billion"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:75
#: templatetags/humanize.py:81
#, python-format
msgid "%(value)s billion"
msgid_plural "%(value)s billion"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:80
#: templatetags/humanize.py:86
#, python-format
msgid "%(value).1f trillion"
msgid_plural "%(value).1f trillion"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:81
#: templatetags/humanize.py:87
#, python-format
msgid "%(value)s trillion"
msgid_plural "%(value)s trillion"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "one"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "two"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "three"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "four"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "five"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "six"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "seven"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "eight"
msgstr ""
#: templatetags/humanize.py:98
#: templatetags/humanize.py:104
msgid "nine"
msgstr ""
#: templatetags/humanize.py:121
#: templatetags/humanize.py:127
msgid "today"
msgstr ""
#: templatetags/humanize.py:123
#: templatetags/humanize.py:129
msgid "tomorrow"
msgstr ""
#: templatetags/humanize.py:125
#: templatetags/humanize.py:131
msgid "yesterday"
msgstr ""
#: templatetags/humanize.py:147
#: templatetags/humanize.py:153
msgid "now"
msgstr ""
#: templatetags/humanize.py:149
#: templatetags/humanize.py:155
#, python-format
msgid "%s seconds ago"
msgstr ""
#: templatetags/humanize.py:151
msgid "a minute ago"
msgstr ""
#: templatetags/humanize.py:153
#, python-format
msgid "%s minutes ago"
msgstr ""
#: templatetags/humanize.py:155
msgid "an hour ago"
msgstr ""
msgid_plural "%s seconds ago"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:157
#, python-format
msgid "%s hours ago"
msgstr ""
msgid "a minute ago"
msgid_plural "%s minutes ago"
msgstr[0] ""
msgstr[1] ""
#: templatetags/humanize.py:159
#, python-format
msgid "an hour ago"
msgid_plural "%s hours ago"
msgstr[0] ""
msgstr[1] ""

View File

@ -152,13 +152,9 @@ def naturaltime(value, arg=None):
elif delta.seconds == 0:
return _(u'now')
elif delta.seconds < 60:
return _(u'%s seconds ago' % (delta.seconds))
elif delta.seconds / 60 < 2:
return _(r'a minute ago')
return ungettext(u'%s seconds ago', u'%s seconds ago', delta.seconds)
elif delta.seconds / 60 < 60:
return _(u'%s minutes ago' % (delta.seconds/60))
elif delta.seconds / 60 / 60 < 2:
return _(u'an hour ago')
return ungettext(u'a minute ago', u'%s minutes ago', delta.seconds/60)
elif delta.seconds / 60 / 60 < 24:
return _(u'%s hours ago' % (delta.seconds/60/60))
return ungettext(u'an hour ago', u'%s hours ago', delta.seconds/60/60)
return naturalday(value, arg)