Replaced context by comment in 2 humanize strings.

This commit is contained in:
Claude Paroz 2018-05-09 09:46:38 +02:00 committed by Carlton Gibson
parent 7ac3008fe4
commit 3574a6d32f
2 changed files with 9 additions and 11 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: 2015-01-17 11:07+0100\n" "POT-Creation-Date: 2018-05-07 18:29+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"
@ -236,9 +236,9 @@ msgstr ""
msgid "yesterday" msgid "yesterday"
msgstr "" msgstr ""
#: contrib/humanize/templatetags/humanize.py:202 #. Translators: delta will contain a string like '2 months' or '1 month, 2 weeks'
#: contrib/humanize/templatetags/humanize.py:223
#, python-format #, python-format
msgctxt "naturaltime"
msgid "%(delta)s ago" msgid "%(delta)s ago"
msgstr "" msgstr ""
@ -274,9 +274,9 @@ msgid_plural "%(count)s hours ago"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: contrib/humanize/templatetags/humanize.py:230 #. Translators: delta will contain a string like '2 months' or '1 month, 2 weeks'
#: contrib/humanize/templatetags/humanize.py:250
#, python-format #, python-format
msgctxt "naturaltime"
msgid "%(delta)s from now" msgid "%(delta)s from now"
msgstr "" msgstr ""

View File

@ -219,9 +219,8 @@ def naturaltime(value):
if value < now: if value < now:
delta = now - value delta = now - value
if delta.days != 0: if delta.days != 0:
return pgettext( # Translators: delta will contain a string like '2 months' or '1 month, 2 weeks'
'naturaltime', '%(delta)s ago' return _('%(delta)s ago') % {'delta': defaultfilters.timesince(value, now)}
) % {'delta': defaultfilters.timesince(value, now)}
elif delta.seconds == 0: elif delta.seconds == 0:
return _('now') return _('now')
elif delta.seconds < 60: elif delta.seconds < 60:
@ -247,9 +246,8 @@ def naturaltime(value):
else: else:
delta = value - now delta = value - now
if delta.days != 0: if delta.days != 0:
return pgettext( # Translators: delta will contain a string like '2 months' or '1 month, 2 weeks'
'naturaltime', '%(delta)s from now' return _('%(delta)s from now') % {'delta': defaultfilters.timeuntil(value, now)}
) % {'delta': defaultfilters.timeuntil(value, now)}
elif delta.seconds == 0: elif delta.seconds == 0:
return _('now') return _('now')
elif delta.seconds < 60: elif delta.seconds < 60: