From 3574a6d32fcd88d404b110a8d2204db1dd14a545 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Wed, 9 May 2018 09:46:38 +0200 Subject: [PATCH] Replaced context by comment in 2 humanize strings. --- .../contrib/humanize/locale/en/LC_MESSAGES/django.po | 10 +++++----- django/contrib/humanize/templatetags/humanize.py | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/django/contrib/humanize/locale/en/LC_MESSAGES/django.po b/django/contrib/humanize/locale/en/LC_MESSAGES/django.po index f39cfde0aa..cf0f2fe34c 100644 --- a/django/contrib/humanize/locale/en/LC_MESSAGES/django.po +++ b/django/contrib/humanize/locale/en/LC_MESSAGES/django.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Django\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" "Last-Translator: Django team\n" "Language-Team: English \n" @@ -236,9 +236,9 @@ msgstr "" msgid "yesterday" 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 -msgctxt "naturaltime" msgid "%(delta)s ago" msgstr "" @@ -274,9 +274,9 @@ msgid_plural "%(count)s hours ago" msgstr[0] "" 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 -msgctxt "naturaltime" msgid "%(delta)s from now" msgstr "" diff --git a/django/contrib/humanize/templatetags/humanize.py b/django/contrib/humanize/templatetags/humanize.py index 7b99d78f1e..482725c88c 100644 --- a/django/contrib/humanize/templatetags/humanize.py +++ b/django/contrib/humanize/templatetags/humanize.py @@ -219,9 +219,8 @@ def naturaltime(value): if value < now: delta = now - value if delta.days != 0: - return pgettext( - 'naturaltime', '%(delta)s ago' - ) % {'delta': defaultfilters.timesince(value, now)} + # Translators: delta will contain a string like '2 months' or '1 month, 2 weeks' + return _('%(delta)s ago') % {'delta': defaultfilters.timesince(value, now)} elif delta.seconds == 0: return _('now') elif delta.seconds < 60: @@ -247,9 +246,8 @@ def naturaltime(value): else: delta = value - now if delta.days != 0: - return pgettext( - 'naturaltime', '%(delta)s from now' - ) % {'delta': defaultfilters.timeuntil(value, now)} + # Translators: delta will contain a string like '2 months' or '1 month, 2 weeks' + return _('%(delta)s from now') % {'delta': defaultfilters.timeuntil(value, now)} elif delta.seconds == 0: return _('now') elif delta.seconds < 60: