From c1ee2a940bf349095bcbb1dbc07ca155f925684a Mon Sep 17 00:00:00 2001 From: Xuesong Date: Sat, 11 Jun 2022 12:39:24 +0800 Subject: [PATCH] Add i18n to `dayssince` filter (#477) --- core/templatetags/duration.py | 6 +++--- locale/zh/LC_MESSAGES/django.mo | Bin 25186 -> 25222 bytes locale/zh/LC_MESSAGES/django.po | 24 +++++++++++++++--------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/core/templatetags/duration.py b/core/templatetags/duration.py index 75bd2cf8..81505669 100644 --- a/core/templatetags/duration.py +++ b/core/templatetags/duration.py @@ -108,9 +108,9 @@ def dayssince(value, today=None): delta = today - value if delta < datetime.timedelta(days=1): - return "today" + return _("today") if delta < datetime.timedelta(days=2): - return "yesterday" + return _("yesterday") # use standard timesince for anything beyond yesterday - return str(delta.days) + " days ago" + return str(delta.days) + _(" days ago") diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index b246a46bde9ec460718b01c8d813ae2772f900da..501875b50d62b0407b1f62dc282cd465c17f53dd 100644 GIT binary patch delta 8611 zcmZwMcYGE_9>?(wA%O%!LQO&-BtU?K5)ueSdhZfS5C{Q6m)?t%6{HDbgJ7pfm9tV# zKqD#wq9Q5^!YNV}5YdAJK|${GedfpO{Nwh;?|IK}c6N4lX7)*ZB~Bbgb^HfLVJwwZFawJz(TgezStRG#$fyvi{LdZgm*C%3o*ayxEN~SY!k<=M~0CRKpn5g(;{RsEft0Gpc)3mQ}H+s3*!3fuHUz7xPHGxZSD&`1+DQdR7a(1I+IZYXo|XV7HY(OFbv0_ zo_HFD<0Izd7()IWmd4enf$hMexEnR_1E}l$&nf7F6Ubn_Q`VpeFRj+D1nPpasHslG z2u!o{&9E4GJ5)ctQ0M!hmU1NO!6so}T#RaW)}8mgixf1HtEeaY3yWdlR5$Wy)Ebt< zO4tZBpaH0*8-|*}=@^O2Q8Tv=)$eZ967EO!d)&@nz$o^gcb9^8e-!VArYs%x1np5B z^+G+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xk%f@Gk8de{G<*e^0t80r_t!{xi%-SsV@hP9~U~8C2GRVrM z%{QsL>+8yYYn#pR!wACf2(@-_YM zV-m$AOB?z+@^7l-UlIwHtNFA(IQ*&G;}w0M5BMBH3?SzDYWUYQyhr3C(rt_psU*21 oIhcbl5Hr=N;P{nTNDL!Z5&a1rzj^pRcRUk+yUdQEE#k`j7v;}dUH||9 diff --git a/locale/zh/LC_MESSAGES/django.po b/locale/zh/LC_MESSAGES/django.po index c06f3d72..88c40874 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Baby Buddy\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-04 03:37+0000\n" +"POT-Creation-Date: 2022-06-07 06:48+0000\n" "Language: zh-Hans\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -1559,6 +1559,20 @@ msgstr "{}, {}" msgid "0 days" msgstr "0天" +#: core/templatetags/duration.py:111 +#: dashboard/templates/cards/diaperchange_types.html:49 +msgid "today" +msgstr "今天" + +#: core/templatetags/duration.py:113 +#: dashboard/templates/cards/diaperchange_types.html:51 +msgid "yesterday" +msgstr "昨天" + +#: core/templatetags/duration.py:116 +msgid " days ago" +msgstr "天之前" + #: core/timeline.py:53 #, python-format msgid "%(child)s started tummy time!" @@ -1694,14 +1708,6 @@ msgstr "小便" msgid "solid" msgstr "大便" -#: dashboard/templates/cards/diaperchange_types.html:49 -msgid "today" -msgstr "今天" - -#: dashboard/templates/cards/diaperchange_types.html:51 -msgid "yesterday" -msgstr "昨天" - #: dashboard/templates/cards/diaperchange_types.html:53 #, python-format msgid "%(key)s days ago"