added a datetime-ago-format in translations to support different sentense order

This commit is contained in:
Eugene Hardbread 2017-03-16 12:11:09 -03:00 committed by Roman Volosovskyi
parent ec079d2e12
commit d0eaa55d9d
4 changed files with 9 additions and 4 deletions

View File

@ -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"})

View File

@ -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"

View File

@ -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"

View File

@ -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)))]