Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #15981 -- Use ungettext instead of manually checking for plural…

…s. Thanks, gasperzejn.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 688abe3b8dcfc007c7244ca0047a64feda445cdc 1 parent 385ae34
Jannis Leidel jezdez authored
BIN  django/contrib/humanize/locale/en/LC_MESSAGES/django.mo
View
Binary file not shown
68 django/contrib/humanize/locale/en/LC_MESSAGES/django.po
View
@@ -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 ""
+msgid_plural "%s seconds ago"
+msgstr[0] ""
+msgstr[1] ""
-#: templatetags/humanize.py:151
+#: templatetags/humanize.py:157
+#, python-format
msgid "a minute ago"
-msgstr ""
+msgid_plural "%s minutes ago"
+msgstr[0] ""
+msgstr[1] ""
-#: templatetags/humanize.py:153
+#: templatetags/humanize.py:159
#, python-format
-msgid "%s minutes ago"
-msgstr ""
-
-#: templatetags/humanize.py:155
msgid "an hour ago"
-msgstr ""
-
-#: templatetags/humanize.py:157
-#, python-format
-msgid "%s hours ago"
-msgstr ""
+msgid_plural "%s hours ago"
+msgstr[0] ""
+msgstr[1] ""
10 django/contrib/humanize/templatetags/humanize.py
View
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.