fix label function

Former-commit-id: 11edd55b5a
This commit is contained in:
Roman Volosovskyi 2016-06-02 15:48:57 +03:00
parent a156c8f865
commit ea06b2da58
2 changed files with 7 additions and 8 deletions

View File

@ -18,7 +18,7 @@
[status-im.components.toolbar :refer [toolbar]]
[status-im.chat.views.message :refer [chat-message]]
[status-im.chat.views.new-message :refer [chat-message-new]]
[status-im.i18n :refer [label label-pluralize]]))
хыефегы-шьюш18т Жкуаук хдфиудъъ))
(defn contacts-by-identity [contacts]
@ -186,7 +186,7 @@
[icon :group st/group-icon]
[text {:style st/members}
(let [cnt (inc (count @contacts))]
(label-pluralize cnt :t/members))]]
(label :t/members {:count cnt}))]]
;; TODO stub data: last activity
[text {:style st/last-activity} (label :t/last-active)])])))

View File

@ -8,11 +8,10 @@
(set! (.-translations js.I18n) (clj->js {:en en/translations}))
(defn label [path & options]
(.t js/I18n (name path) (clj->js options)))
(defn label-pluralize [count path & options]
(.p js/I18n count (name path) (clj->js options)))
(defn label
([path] (label path {}))
([path options]
(.t js/I18n (name path) (clj->js options))))
(comment
(defn deep-merge [& maps]
@ -23,4 +22,4 @@
(defn add-translations [new-translations]
(let [translations (.-translations js/I18n)]
(set! (.-translations js/I18n) (clj->js (deep-merge (js->clj translations) new-translations)))))
)
)