added a datetime-ago-format in translations to support different sentense order
This commit is contained in:
parent
ec079d2e12
commit
d0eaa55d9d
|
@ -45,6 +45,7 @@
|
||||||
:status-failed "Fehlgeschlagen"
|
:status-failed "Fehlgeschlagen"
|
||||||
|
|
||||||
;datetime
|
;datetime
|
||||||
|
:datetime-ago-format "{{ago}} {{number}} {{time-intervals}}"
|
||||||
:datetime-second {:one "Sekunde"
|
:datetime-second {:one "Sekunde"
|
||||||
:other "Sekunden"}
|
:other "Sekunden"}
|
||||||
:datetime-minute {:one "Minute"
|
:datetime-minute {:one "Minute"
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
:status-failed "Failed"
|
:status-failed "Failed"
|
||||||
|
|
||||||
;datetime
|
;datetime
|
||||||
|
:datetime-ago-format "{{number}} {{time-intervals}} {{ago}}"
|
||||||
:datetime-second {:one "second"
|
:datetime-second {:one "second"
|
||||||
:other "seconds"}
|
:other "seconds"}
|
||||||
:datetime-minute {:one "minute"
|
:datetime-minute {:one "minute"
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
:status-failed "Fallido"
|
:status-failed "Fallido"
|
||||||
|
|
||||||
;datetime
|
;datetime
|
||||||
|
:datetime-ago-format "{{ago}} {{number}} {{time-intervals}}"
|
||||||
:datetime-second {:one "segundo"
|
:datetime-second {:one "segundo"
|
||||||
:other "segundos"}
|
:other "segundos"}
|
||||||
:datetime-minute {:one "minuto"
|
:datetime-minute {:one "minuto"
|
||||||
|
|
|
@ -40,7 +40,9 @@
|
||||||
|
|
||||||
(defn format-time-ago [diff unit]
|
(defn format-time-ago [diff unit]
|
||||||
(let [name (label-pluralize diff (:name 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]
|
(defn time-ago [time]
|
||||||
(let [diff (t/in-seconds (t/interval time (t/now)))]
|
(let [diff (t/in-seconds (t/interval time (t/now)))]
|
||||||
|
|
Loading…
Reference in New Issue