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 "" msgstr ""
"Project-Id-Version: Django\n" "Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: 2010-05-13 15:35+0200\n"
"Last-Translator: Django team\n" "Last-Translator: Django team\n"
"Language-Team: English <en@li.org>\n" "Language-Team: English <en@li.org>\n"
@ -28,119 +28,117 @@ msgstr ""
msgid "rd" msgid "rd"
msgstr "" msgstr ""
#: templatetags/humanize.py:68 #: templatetags/humanize.py:74
#, python-format #, python-format
msgid "%(value).1f million" msgid "%(value).1f million"
msgid_plural "%(value).1f million" msgid_plural "%(value).1f million"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: templatetags/humanize.py:69 #: templatetags/humanize.py:75
#, python-format #, python-format
msgid "%(value)s million" msgid "%(value)s million"
msgid_plural "%(value)s million" msgid_plural "%(value)s million"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: templatetags/humanize.py:74 #: templatetags/humanize.py:80
#, python-format #, python-format
msgid "%(value).1f billion" msgid "%(value).1f billion"
msgid_plural "%(value).1f billion" msgid_plural "%(value).1f billion"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: templatetags/humanize.py:75 #: templatetags/humanize.py:81
#, python-format #, python-format
msgid "%(value)s billion" msgid "%(value)s billion"
msgid_plural "%(value)s billion" msgid_plural "%(value)s billion"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: templatetags/humanize.py:80 #: templatetags/humanize.py:86
#, python-format #, python-format
msgid "%(value).1f trillion" msgid "%(value).1f trillion"
msgid_plural "%(value).1f trillion" msgid_plural "%(value).1f trillion"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: templatetags/humanize.py:81 #: templatetags/humanize.py:87
#, python-format #, python-format
msgid "%(value)s trillion" msgid "%(value)s trillion"
msgid_plural "%(value)s trillion" msgid_plural "%(value)s trillion"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "one" msgid "one"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "two" msgid "two"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "three" msgid "three"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "four" msgid "four"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "five" msgid "five"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "six" msgid "six"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "seven" msgid "seven"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "eight" msgid "eight"
msgstr "" msgstr ""
#: templatetags/humanize.py:98 #: templatetags/humanize.py:104
msgid "nine" msgid "nine"
msgstr "" msgstr ""
#: templatetags/humanize.py:121 #: templatetags/humanize.py:127
msgid "today" msgid "today"
msgstr "" msgstr ""
#: templatetags/humanize.py:123 #: templatetags/humanize.py:129
msgid "tomorrow" msgid "tomorrow"
msgstr "" msgstr ""
#: templatetags/humanize.py:125 #: templatetags/humanize.py:131
msgid "yesterday" msgid "yesterday"
msgstr "" msgstr ""
#: templatetags/humanize.py:147 #: templatetags/humanize.py:153
msgid "now" msgid "now"
msgstr "" msgstr ""
#: templatetags/humanize.py:149 #: templatetags/humanize.py:155
#, python-format #, python-format
msgid "%s seconds ago" msgid "%s seconds ago"
msgstr "" msgid_plural "%s seconds ago"
msgstr[0] ""
#: templatetags/humanize.py:151 msgstr[1] ""
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 ""
#: templatetags/humanize.py:157 #: templatetags/humanize.py:157
#, python-format #, python-format
msgid "%s hours ago" msgid "a minute ago"
msgstr "" 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: elif delta.seconds == 0:
return _(u'now') return _(u'now')
elif delta.seconds < 60: elif delta.seconds < 60:
return _(u'%s seconds ago' % (delta.seconds)) return ungettext(u'%s seconds ago', u'%s seconds ago', delta.seconds)
elif delta.seconds / 60 < 2:
return _(r'a minute ago')
elif delta.seconds / 60 < 60: elif delta.seconds / 60 < 60:
return _(u'%s minutes ago' % (delta.seconds/60)) return ungettext(u'a minute ago', u'%s minutes ago', delta.seconds/60)
elif delta.seconds / 60 / 60 < 2:
return _(u'an hour ago')
elif delta.seconds / 60 / 60 < 24: 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) return naturalday(value, arg)