diff --git a/core/templatetags/duration.py b/core/templatetags/duration.py index 905915bb..a1fada8a 100644 --- a/core/templatetags/duration.py +++ b/core/templatetags/duration.py @@ -102,10 +102,12 @@ def dayssince(value, today=None): :param today: date to compare to (defaults to today) :returns: the formatted string """ + if today is None: today = timezone.localtime().date() delta = today - value + days_ago = _(" ") + str(delta.days) + _(" days ago") if delta < datetime.timedelta(days=1): return _("today") @@ -113,7 +115,7 @@ def dayssince(value, today=None): return _("yesterday") # use standard timesince for anything beyond yesterday - return str(delta.days) + _(" days ago") + return days_ago @register.filter diff --git a/dashboard/templates/cards/sleep_recent.html b/dashboard/templates/cards/sleep_recent.html index 603dc50b..87cb2921 100644 --- a/dashboard/templates/cards/sleep_recent.html +++ b/dashboard/templates/cards/sleep_recent.html @@ -25,7 +25,7 @@ {% blocktrans trimmed count counter=sleep.count %} {{ counter }} sleep {% plural %} - {{ counter }} sleep + {{ counter }} sleeps {% endblocktrans %} {% endif %} diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo index 73adc5c4..ef0c9515 100644 Binary files a/locale/fr/LC_MESSAGES/django.mo and b/locale/fr/LC_MESSAGES/django.mo differ diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 17c1365f..c7793c6f 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -1026,7 +1026,7 @@ msgstr "Chronomètres actifs" #: dashboard/templates/cards/sleep_recent.html:52 #: dashboard/templates/cards/tummytime_day.html:14 msgid "None" -msgstr "Aucun" +msgstr "Aucun(e)" #: core/templates/core/tummytime_confirm_delete.html:4 msgid "Delete a Tummy Time Entry" @@ -1182,9 +1182,9 @@ msgstr "Dernier sommeil" msgid "Today's Naps" msgstr "Siestes aujourd'hui" -#: dashboard/templates/cards/sleep_naps_day.html:12 -msgid "%(count)s nap%(plural)s" -msgstr "%(count)s sieste%(plural)s" +#: dashboard/templates/cards/sleep_recent.html:4 +msgid "Recent Sleep" +msgstr "Compteur de sommeil" #: dashboard/templates/cards/statistics.html:7 msgid "Statistics" @@ -1700,6 +1700,15 @@ msgid "Today" msgstr "Aujourd'hui" #: core/templatetags/datetime.py:41 +#: core/templatetags/duration.py:110 +msgid " days ago" +msgstr " jours" + +#: core/templatetags/duration.py:110 +msgid " " +msgstr "il y a " + +#: core/templatetags/datetime.py:75 msgid "{}, {}" msgstr "{}, {}" @@ -1721,7 +1730,7 @@ msgstr "Contenu : %(contents)s" #: dashboard/templates/cards/sleep_last.html:12 #: dashboard/templates/cards/tummytime_last.html:13 msgid "