From d0eaa55d9dc24b209567c18c33cbff9a8069d05b Mon Sep 17 00:00:00 2001 From: Eugene Hardbread Date: Thu, 16 Mar 2017 12:11:09 -0300 Subject: [PATCH] added a datetime-ago-format in translations to support different sentense order --- src/status_im/translations/de.cljs | 7 ++++--- src/status_im/translations/en.cljs | 1 + src/status_im/translations/es.cljs | 1 + src/status_im/utils/datetime.cljs | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/status_im/translations/de.cljs b/src/status_im/translations/de.cljs index a564ceaf09..0303ea3a19 100644 --- a/src/status_im/translations/de.cljs +++ b/src/status_im/translations/de.cljs @@ -45,6 +45,7 @@ :status-failed "Fehlgeschlagen" ;datetime + :datetime-ago-format "{{ago}} {{number}} {{time-intervals}}" :datetime-second {:one "Sekunde" :other "Sekunden"} :datetime-minute {:one "Minute" @@ -53,7 +54,7 @@ :other "Stunden"} :datetime-day {:one "Tag" :other "Tage"} - :datetime-multiple "s" + :datetime-multiple "s" :datetime-ago "vor" :datetime-yesterday "Gestern" :datetime-today "Heute" @@ -217,6 +218,6 @@ :one-more-item "Noch ein Objekt" :fee "Gebühr" :value "Wert" - - ;:webview + + ;:webview :web-view-error "Ups, Fehler"}) diff --git a/src/status_im/translations/en.cljs b/src/status_im/translations/en.cljs index 8b9b009193..12916d3c2f 100644 --- a/src/status_im/translations/en.cljs +++ b/src/status_im/translations/en.cljs @@ -51,6 +51,7 @@ :status-failed "Failed" ;datetime + :datetime-ago-format "{{number}} {{time-intervals}} {{ago}}" :datetime-second {:one "second" :other "seconds"} :datetime-minute {:one "minute" diff --git a/src/status_im/translations/es.cljs b/src/status_im/translations/es.cljs index a9413c8821..937f4673a2 100644 --- a/src/status_im/translations/es.cljs +++ b/src/status_im/translations/es.cljs @@ -45,6 +45,7 @@ :status-failed "Fallido" ;datetime + :datetime-ago-format "{{ago}} {{number}} {{time-intervals}}" :datetime-second {:one "segundo" :other "segundos"} :datetime-minute {:one "minuto" diff --git a/src/status_im/utils/datetime.cljs b/src/status_im/utils/datetime.cljs index 103f81d855..98ea60546a 100644 --- a/src/status_im/utils/datetime.cljs +++ b/src/status_im/utils/datetime.cljs @@ -40,7 +40,9 @@ (defn format-time-ago [diff unit] (let [name (label-pluralize diff (:name unit))] - (gstring/format "%s %s %s" diff name (label :t/datetime-ago)))) + (label :t/datetime-ago-format {:ago (label :t/datetime-ago) + :number diff + :time-intervals name}))) (defn time-ago [time] (let [diff (t/in-seconds (t/interval time (t/now)))]