From ea06b2da584d06aa99a7678f5c4073608fbded5c Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 2 Jun 2016 15:48:57 +0300 Subject: [PATCH] fix label function Former-commit-id: 11edd55b5a5a8205195c02e52cd3fc20a606889a --- src/status_im/chat/screen.cljs | 4 ++-- src/status_im/i18n.cljs | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/status_im/chat/screen.cljs b/src/status_im/chat/screen.cljs index 3ff250e238..a77f78bcc0 100644 --- a/src/status_im/chat/screen.cljs +++ b/src/status_im/chat/screen.cljs @@ -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)])]))) diff --git a/src/status_im/i18n.cljs b/src/status_im/i18n.cljs index de557041fc..6d3815715a 100644 --- a/src/status_im/i18n.cljs +++ b/src/status_im/i18n.cljs @@ -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))))) - ) \ No newline at end of file + )