changed translation style

This commit is contained in:
Adrian Tiberius 2016-05-25 18:57:06 +03:00
parent 930d201764
commit 182600b2d7
19 changed files with 230 additions and 202 deletions

View File

@ -18,7 +18,7 @@
[status-im.components.toolbar :refer [toolbar]] [status-im.components.toolbar :refer [toolbar]]
[status-im.chat.views.message :refer [chat-message]] [status-im.chat.views.message :refer [chat-message]]
[status-im.chat.views.new-message :refer [chat-message-new]] [status-im.chat.views.new-message :refer [chat-message-new]]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn contacts-by-identity [contacts] (defn contacts-by-identity [contacts]
@ -47,7 +47,7 @@
[view st/typing-view [view st/typing-view
[view st/typing-background [view st/typing-background
[text {:style st/typing-text} [text {:style st/typing-text}
(str member " " (t :chat.is-typing))]]]) (str member " " (label :t/is-typing))]]])
(defn typing-all [] (defn typing-all []
[view st/typing-all [view st/typing-all
@ -101,63 +101,63 @@
[chat-icon-view-menu-item chat-id group-chat name color true]) [chat-icon-view-menu-item chat-id group-chat name color true])
(defn members-text [members] (defn members-text [members]
(truncate-str (str (s/join ", " (map #(:name %) members)) " " (t :chat.and-you)) 35)) (truncate-str (str (s/join ", " (map #(:name %) members)) " " (label :t/and-you)) 35))
(defn actions-list-view [] (defn actions-list-view []
(let [{:keys [group-chat chat-id]} (let [{:keys [group-chat chat-id]}
(subscribe [:chat-properties [:group-chat :chat-id]]) (subscribe [:chat-properties [:group-chat :chat-id]])
members (subscribe [:current-chat-contacts])] members (subscribe [:current-chat-contacts])]
(when-let [actions (if @group-chat (when-let [actions (if @group-chat
[{:title (t :members-title) [{:title (label :t/members-title)
:subtitle (members-text @members) :subtitle (members-text @members)
:icon :menu_group :icon :menu_group
:icon-style {:width 25 :icon-style {:width 25
:height 19} :height 19}
;; TODO not implemented: action Members ;; TODO not implemented: action Members
:handler nil} :handler nil}
{:title (t :chat.search-chat) {:title (label :t/search-chat)
:subtitle (t :not-implemented) :subtitle (label :t/not-implemented)
:icon :search_gray_copy :icon :search_gray_copy
:icon-style {:width 17 :icon-style {:width 17
:height 17} :height 17}
;; TODO not implemented: action Search chat ;; TODO not implemented: action Search chat
:handler nil} :handler nil}
{:title (t :notifications.title) {:title (label :t/notifications-title)
:subtitle (t :not-implemented) :subtitle (label :t/not-implemented)
;;:subtitle "Chat muted" ;;:subtitle "Chat muted"
:icon :muted :icon :muted
:icon-style {:width 18 :icon-style {:width 18
:height 21} :height 21}
;; TODO not implemented: action Notifications ;; TODO not implemented: action Notifications
:handler nil} :handler nil}
{:title (t :settings.title) {:title (label :t/settings)
:icon :settings :icon :settings
:icon-style {:width 20 :icon-style {:width 20
:height 13} :height 13}
:handler #(dispatch [:show-group-settings])}] :handler #(dispatch [:show-group-settings])}]
[{:title (t :profile.title) [{:title (label :t/profile)
:custom-icon [menu-item-icon-profile] :custom-icon [menu-item-icon-profile]
:icon :menu_group :icon :menu_group
:icon-style {:width 25 :icon-style {:width 25
:height 19} :height 19}
:handler #(dispatch [:show-profile @chat-id])} :handler #(dispatch [:show-profile @chat-id])}
{:title (t :chat.search-chat) {:title (label :t/search-chat)
:subtitle (t :not-implemented) :subtitle (label :t/not-implemented)
:icon :search_gray_copy :icon :search_gray_copy
:icon-style {:width 17 :icon-style {:width 17
:height 17} :height 17}
;; TODO not implemented: action Search chat ;; TODO not implemented: action Search chat
:handler nil} :handler nil}
{:title (t :notifications.title) {:title (label :t/notifications-title)
:subtitle (t :not-implemented) :subtitle (label :t/not-implemented)
;;:subtitle "Notifications on" ;;:subtitle "Notifications on"
:icon :muted :icon :muted
:icon-style {:width 18 :icon-style {:width 18
:height 21} :height 21}
;; TODO not implemented: action Notifications ;; TODO not implemented: action Notifications
:handler nil} :handler nil}
{:title (t :settings.title) {:title (label :t/settings)
:subtitle (t :not-implemented) :subtitle (label :t/not-implemented)
:icon :settings :icon :settings
:icon-style {:width 20 :icon-style {:width 20
:height 13} :height 13}
@ -180,15 +180,15 @@
(fn [] (fn []
[view (st/chat-name-view @show-actions) [view (st/chat-name-view @show-actions)
[text {:style st/chat-name-text} [text {:style st/chat-name-text}
(truncate-str (or @name (t :chat-name)) 30)] (truncate-str (or @name (label :t/chat-name)) 30)]
(if @group-chat (if @group-chat
[view {:flexDirection :row} [view {:flexDirection :row}
[icon :group st/group-icon] [icon :group st/group-icon]
[text {:style st/members} [text {:style st/members}
(let [cnt (inc (count @contacts))] (let [cnt (inc (count @contacts))]
(t :chat.members {:count cnt}))]] (label :t/members {:count cnt}))]]
;; TODO stub data: last activity ;; TODO stub data: last activity
[text {:style st/last-activity} (t :chat.last-active)])]))) [text {:style st/last-activity} (label :t/last-active)])])))
(defn toolbar-action [] (defn toolbar-action []
(let [show-actions (subscribe [:show-actions])] (let [show-actions (subscribe [:show-actions])]

View File

@ -14,7 +14,7 @@
content-type-command content-type-command
content-type-command-request content-type-command-request
content-type-status]] content-type-status]]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn send-console-msg [text] (defn send-console-msg [text]
{:msg-id (random/id) {:msg-id (random/id)
@ -33,7 +33,7 @@
(defn on-sync-contacts [] (defn on-sync-contacts []
(dispatch [:received-msg (dispatch [:received-msg
{:msg-id (random/id) {:msg-id (random/id)
:content (t :sign-up.contacts-syncronized) :content (label :t/contacts-syncronized)
:content-type text-content-type :content-type text-content-type
:outgoing false :outgoing false
:from "console" :from "console"
@ -71,7 +71,7 @@
{:msg-id msg-id {:msg-id msg-id
:content (command-content :content (command-content
:confirmation-code :confirmation-code
(t :sign-up.confirmation-code)) (label :t/confirmation-code))
:content-type content-type-command-request :content-type content-type-command-request
:outgoing false :outgoing false
:from "console" :from "console"
@ -95,21 +95,21 @@
;; TODO validate and save password ;; TODO validate and save password
(dispatch [:received-msg (dispatch [:received-msg
{:msg-id (random/id) {:msg-id (random/id)
:content (t :sign-up.password-saved) :content (label :t/password-saved)
:content-type text-content-type :content-type text-content-type
:outgoing false :outgoing false
:from "console" :from "console"
:to "me"}]) :to "me"}])
(dispatch [:received-msg (dispatch [:received-msg
{:msg-id (random/id) {:msg-id (random/id)
:content (t :sign-up.generate-passphrase) :content (label :t/generate-passphrase)
:content-type text-content-type :content-type text-content-type
:outgoing false :outgoing false
:from "console" :from "console"
:to "me"}]) :to "me"}])
(dispatch [:received-msg (dispatch [:received-msg
{:msg-id (random/id) {:msg-id (random/id)
:content (t :sign-up.passphrase) :content (label :t/passphrase)
:content-type text-content-type :content-type text-content-type
:outgoing false :outgoing false
:from "console" :from "console"
@ -126,7 +126,7 @@
:to "me"}])) :to "me"}]))
(dispatch [:received-msg (dispatch [:received-msg
{:msg-id "8" {:msg-id "8"
:content (t :sign-up.written-down) :content (label :t/written-down)
:content-type text-content-type :content-type text-content-type
:outgoing false :outgoing false
:from "console" :from "console"
@ -137,7 +137,7 @@
{:msg-id msg-id {:msg-id msg-id
:content (command-content :content (command-content
:phone :phone
(t :sign-up.phone-number-required)) (label :t/phone-number-required))
:content-type content-type-command-request :content-type content-type-command-request
:outgoing false :outgoing false
:from "console" :from "console"
@ -145,7 +145,7 @@
(def intro-status (def intro-status
{:msg-id "intro-status" {:msg-id "intro-status"
:content (t :sign-up.intro-status) :content (label :t/intro-status)
:delivery-status "seen" :delivery-status "seen"
:from "console" :from "console"
:chat-id "console" :chat-id "console"
@ -157,14 +157,14 @@
(dispatch [:received-msg intro-status]) (dispatch [:received-msg intro-status])
(dispatch [:received-msg (dispatch [:received-msg
{:msg-id "intro-message1" {:msg-id "intro-message1"
:content (t :sign-up.intro-message1) :content (label :t/intro-message1)
:content-type text-content-type :content-type text-content-type
:outgoing false :outgoing false
:from "console" :from "console"
:to "me"}]) :to "me"}])
(dispatch [:received-msg (dispatch [:received-msg
{:msg-id "intro-message2" {:msg-id "intro-message2"
:content (t :sign-up.intro-message2) :content (label :t/intro-message2)
:content-type text-content-type :content-type text-content-type
:outgoing false :outgoing false
:from "console" :from "console"
@ -174,7 +174,7 @@
{:msg-id msg-id {:msg-id msg-id
:content (command-content :content (command-content
:keypair-password :keypair-password
(t :sign-up.keypair-generated)) (label :t/keypair-generated))
:content-type content-type-command-request :content-type content-type-command-request
:outgoing false :outgoing false
:from "console" :from "console"

View File

@ -16,14 +16,14 @@
toolbar-background2]] toolbar-background2]]
[status-im.components.toolbar :refer [toolbar]] [status-im.components.toolbar :refer [toolbar]]
[status-im.components.icons.ionicons :refer [icon]] [status-im.components.icons.ionicons :refer [icon]]
[status-im.i18n :refer [t]] [status-im.i18n :refer [label]]
[status-im.chats-list.styles :as st])) [status-im.chats-list.styles :as st]))
(defn chats-list-toolbar [] (defn chats-list-toolbar []
[toolbar {:nav-action {:image {:source {:uri :icon_hamburger} [toolbar {:nav-action {:image {:source {:uri :icon_hamburger}
:style st/hamburger-icon} :style st/hamburger-icon}
:handler open-drawer} :handler open-drawer}
:title (t :chats.title) :title (label :t/chats)
:background-color toolbar-background2 :background-color toolbar-background2
;; TODO implement search ;; TODO implement search
:action {:image {:source {:uri :icon_search} :action {:image {:source {:uri :icon_search}
@ -44,13 +44,13 @@
:offsetY 16 :offsetY 16
:offsetX 16} :offsetX 16}
[action-button-item [action-button-item
{:title (t :chats.new-chat) {:title (label :t/new-chat)
:buttonColor :#9b59b6 :buttonColor :#9b59b6
:onPress #(dispatch [:navigate-to :contact-list])} :onPress #(dispatch [:navigate-to :contact-list])}
[icon {:name :android-create [icon {:name :android-create
:style st/create-icon}]] :style st/create-icon}]]
[action-button-item [action-button-item
{:title (t :chats.new-group-chat) {:title (label :t/new-group-chat)
:buttonColor :#1abc9c :buttonColor :#1abc9c
:onPress #(dispatch [:show-group-new])} :onPress #(dispatch [:show-group-new])}
[icon {:name :person-stalker [icon {:name :person-stalker

View File

@ -12,7 +12,7 @@
touchable-opacity]] touchable-opacity]]
[status-im.resources :as res] [status-im.resources :as res]
[status-im.components.drawer.styles :as st] [status-im.components.drawer.styles :as st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defonce drawer-atom (atom)) (defonce drawer-atom (atom))
@ -46,21 +46,21 @@
[text {:style st/name-text} [text {:style st/name-text}
@username]] @username]]
[view st/menu-items-container [view st/menu-items-container
[menu-item {:name (t :profile.title) [menu-item {:name (label :t/profile)
:handler #(dispatch [:navigate-to :my-profile])}] :handler #(dispatch [:navigate-to :my-profile])}]
[menu-item {:name (t :settings.title) [menu-item {:name (label :t/settings)
:handler (fn [] :handler (fn []
;; TODO not implemented ;; TODO not implemented
)}] )}]
[menu-item {:name (t :discovery.title) [menu-item {:name (label :t/discovery)
:handler #(dispatch [:navigate-to :discovery])}] :handler #(dispatch [:navigate-to :discovery])}]
[menu-item {:name (t :contacts.title) [menu-item {:name (label :t/contacts)
:handler #(dispatch [:show-contacts navigator])}] :handler #(dispatch [:show-contacts navigator])}]
[menu-item {:name (t :invite-friends.title) [menu-item {:name (label :t/invite-friends)
:handler (fn [] :handler (fn []
;; TODO not implemented ;; TODO not implemented
)}] )}]
[menu-item {:name (t :faq.title) [menu-item {:name (label :t/faq)
:handler (fn [])}]] :handler (fn [])}]]
[view st/switch-users-container [view st/switch-users-container
[touchable-opacity {:onPress (fn [] [touchable-opacity {:onPress (fn []
@ -68,7 +68,7 @@
;; TODO not implemented ;; TODO not implemented
)} )}
[text {:style st/switch-users-text} [text {:style st/switch-users-text}
(t :drawer.switch-users)]]]]))) (label :t/switch-users)]]]])))
(defn drawer-view [items] (defn drawer-view [items]
[drawer-layout-android {:drawerWidth 260 [drawer-layout-android {:drawerWidth 260

View File

@ -12,19 +12,19 @@
[status-im.components.tabs.tabs :refer [tabs]] [status-im.components.tabs.tabs :refer [tabs]]
[status-im.components.tabs.styles :as st] [status-im.components.tabs.styles :as st]
[status-im.components.styles :as common-st] [status-im.components.styles :as common-st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(def tab-list (def tab-list
[{:view-id :chat-list [{:view-id :chat-list
:title (t :chats.title) :title (label :t/chats)
:screen chats-list :screen chats-list
:icon :icon_tab_chats} :icon :icon_tab_chats}
{:view-id :discovery {:view-id :discovery
:title (t :discovery.title) :title (label :t/discovery)
:screen discovery :screen discovery
:icon :icon_tab_discovery} :icon :icon_tab_discovery}
{:view-id :contact-list {:view-id :contact-list
:title (t :contacts.title) :title (label :t/contacts)
:screen contact-list :screen contact-list
:icon :icon_tab_contacts}]) :icon :icon_tab_contacts}])

View File

@ -11,13 +11,13 @@
[status-im.components.toolbar :refer [toolbar]] [status-im.components.toolbar :refer [toolbar]]
[status-im.contacts.styles :as st] [status-im.contacts.styles :as st]
[status-im.utils.listview :as lw] [status-im.utils.listview :as lw]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn render-row [row _ _] (defn render-row [row _ _]
(list-item [contact-view row])) (list-item [contact-view row]))
(defn contact-list-toolbar [] (defn contact-list-toolbar []
[toolbar {:title (t :contacts.title) [toolbar {:title (label :t/contacts)
:background-color toolbar-background2 :background-color toolbar-background2
:action {:image {:source {:uri :icon_search} :action {:image {:source {:uri :icon_search}
:style st/search-icon} :style st/search-icon}

View File

@ -3,7 +3,7 @@
[status-im.components.react :refer [view image text]] [status-im.components.react :refer [view image text]]
[status-im.resources :as res] [status-im.resources :as res]
[status-im.contacts.styles :as st] [status-im.contacts.styles :as st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn contact-photo [{:keys [photo-path]}] (defn contact-photo [{:keys [photo-path]}]
[view st/contact-photo-container [view st/contact-photo-container
@ -28,4 +28,4 @@
(if (pos? (count name)) (if (pos? (count name))
name name
;; todo is this correct behaviour? ;; todo is this correct behaviour?
(t :contacts.no-name))]]]) (label :t/no-name))]]])

View File

@ -10,7 +10,7 @@
[status-im.discovery.views.popular :refer [popular]] [status-im.discovery.views.popular :refer [popular]]
[status-im.discovery.views.recent :refer [discovery-recent]] [status-im.discovery.views.recent :refer [discovery-recent]]
[status-im.discovery.styles :as st] [status-im.discovery.styles :as st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn get-hashtags [status] (defn get-hashtags [status]
(let [hashtags (map #(subs % 1) (re-seq #"#[^ !?,;:.]+" status))] (let [hashtags (map #(subs % 1) (re-seq #"#[^ !?,;:.]+" status))]
@ -21,13 +21,13 @@
(if show-search (if show-search
[text-input {:style st/discovery-search-input [text-input {:style st/discovery-search-input
:autoFocus true :autoFocus true
:placeholder (t :discovery.search-tags) :placeholder (label :t/search-tags)
:onSubmitEditing (fn [e] :onSubmitEditing (fn [e]
(let [search (aget e "nativeEvent" "text") (let [search (aget e "nativeEvent" "text")
hashtags (get-hashtags search)] hashtags (get-hashtags search)]
(dispatch [:broadcast-status search hashtags])))}] (dispatch [:broadcast-status search hashtags])))}]
[view [view
[text {:style st/discovery-title} (t :discovery.title)]])]) [text {:style st/discovery-title} (label :t/discovery)]])])
(defn toogle-search [current-value] (defn toogle-search [current-value]
(dispatch [:set ::show-search (not current-value)])) (dispatch [:set ::show-search (not current-value)]))
@ -46,8 +46,8 @@
:handler #(toogle-search show-search)}}] :handler #(toogle-search show-search)}}]
[scroll-view st/scroll-view-container [scroll-view st/scroll-view-container
[view st/section-spacing [view st/section-spacing
[text {:style st/discovery-subtitle} (t :discovery.popular-tags)]] [text {:style st/discovery-subtitle} (label :t/popular-tags)]]
[popular] [popular]
[view st/section-spacing [view st/section-spacing
[text {:style st/discovery-subtitle} (t :discovery.recent)]] [text {:style st/discovery-subtitle} (label :t/recent)]]
[discovery-recent]]]) [discovery-recent]]])

View File

@ -8,7 +8,7 @@
[status-im.components.carousel.carousel :refer [carousel]] [status-im.components.carousel.carousel :refer [carousel]]
[status-im.discovery.styles :as st] [status-im.discovery.styles :as st]
[status-im.discovery.views.popular-list :refer [discovery-popular-list]] [status-im.discovery.views.popular-list :refer [discovery-popular-list]]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn page-width [] (defn page-width []
(.-width (.get (.. js/React -Dimensions) "window"))) (.-width (.get (.. js/React -Dimensions) "window")))
@ -20,4 +20,4 @@
:sneak 20} :sneak 20}
(for [{:keys [name count]} popular-tags] (for [{:keys [name count]} popular-tags]
[discovery-popular-list name count])] [discovery-popular-list name count])]
[text (t :discovery.none)])) [text (label :t/none)]))

View File

@ -15,7 +15,7 @@
[status-im.components.chat-icon.screen :refer [chat-icon-view-action]] [status-im.components.chat-icon.screen :refer [chat-icon-view-action]]
[status-im.group-settings.styles.group-settings :as st] [status-im.group-settings.styles.group-settings :as st]
[status-im.group-settings.views.member :refer [member-view]] [status-im.group-settings.views.member :refer [member-view]]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn remove-member [] (defn remove-member []
(dispatch [:remove-participants])) (dispatch [:remove-participants]))
@ -36,7 +36,7 @@
[text {:style st/modal-member-name} name] [text {:style st/modal-member-name} name]
[touchable-highlight {:on-press remove-member} [touchable-highlight {:on-press remove-member}
[text {:style st/modal-remove-text} [text {:style st/modal-remove-text}
(t :group-settings.remove)]]]]])) (label :t/remove)]]]]]))
(defview chat-members [] (defview chat-members []
[members [:current-chat-contacts]] [members [:current-chat-contacts]]
@ -76,13 +76,13 @@
[view st/modal-color-picker-inner-container [view st/modal-color-picker-inner-container
[picker {:selectedValue new-color [picker {:selectedValue new-color
:onValueChange #(dispatch [:set :new-chat-color %])} :onValueChange #(dispatch [:set :new-chat-color %])}
[picker-item {:label (t :colors.blue) :value "#7099e6"}] [picker-item {:label (label :t/blue) :value "#7099e6"}]
[picker-item {:label (t :colors.purple) :value "#a187d5"}] [picker-item {:label (label :t/purple) :value "#a187d5"}]
[picker-item {:label (t :colors.green) :value "green"}] [picker-item {:label (label :t/green) :value "green"}]
[picker-item {:label (t :colors.red) :value "red"}]] [picker-item {:label (label :t/red) :value "red"}]]
[touchable-highlight {:on-press set-chat-color} [touchable-highlight {:on-press set-chat-color}
[text {:style st/modal-color-picker-save-btn-text} [text {:style st/modal-color-picker-save-btn-text}
(t :group-settings.save)]]]]]) (label :t/save)]]]]])
(defview chat-color-icon [] (defview chat-color-icon []
[chat-color [:chat :color]] [chat-color [:chat :color]]
@ -93,11 +93,11 @@
(defn settings-view [] (defn settings-view []
(let [settings [{:custom-icon [chat-color-icon] (let [settings [{:custom-icon [chat-color-icon]
:title (t :group-settings.change-color) :title (label :t/change-color)
:handler show-chat-color-picker} :handler show-chat-color-picker}
;; TODO not implemented: Notifications ;; TODO not implemented: Notifications
(merge {:title (t :notifications.title) (merge {:title (label :t/notifications-title)
:subtitle (t :not-implemented) :subtitle (label :t/not-implemented)
:handler nil} :handler nil}
(if true (if true
{:icon :notifications-on {:icon :notifications-on
@ -109,13 +109,13 @@
{:icon :close-gray {:icon :close-gray
:icon-style {:width 12 :icon-style {:width 12
:height 12} :height 12}
:title (t :group-settings.clear-history) :title (label :t/clear-history)
;; TODO show confirmation dialog? ;; TODO show confirmation dialog?
:handler #(dispatch [:clear-history])} :handler #(dispatch [:clear-history])}
{:icon :bin {:icon :bin
:icon-style {:width 12 :icon-style {:width 12
:height 18} :height 18}
:title (t :group-settings.delete-and-leave) :title (label :t/delete-and-leave)
;; TODO show confirmation dialog? ;; TODO show confirmation dialog?
:handler #(dispatch [:leave-group-chat])}]] :handler #(dispatch [:leave-group-chat])}]]
[view st/settings-container [view st/settings-container
@ -131,7 +131,7 @@
[chat-icon-view-action chat-id group-chat name color false]]) [chat-icon-view-action chat-id group-chat name color false]])
(defn new-group-toolbar [] (defn new-group-toolbar []
[toolbar {:title (t :group-settings.chat-settings) [toolbar {:title (label :t/chat-settings)
:custom-action [chat-icon]}]) :custom-action [chat-icon]}])
(defn focus [] (defn focus []
@ -148,7 +148,7 @@
new-name [:get :new-chat-name] new-name [:get :new-chat-name]
focused? [:get ::name-input-focused]] focused? [:get ::name-input-focused]]
[view [view
[text {:style st/chat-name-text} (t :chat-name)] [text {:style st/chat-name-text} (label :t/chat-name)]
[view (st/chat-name-value-container focused?) [view (st/chat-name-value-container focused?)
[text-input {:style st/chat-name-value [text-input {:style st/chat-name-value
:ref #(when (and % focused?) (.focus %)) :ref #(when (and % focused?) (.focus %))
@ -162,7 +162,7 @@
[view [icon :ok-purple st/add-members-icon]]] [view [icon :ok-purple st/add-members-icon]]]
[touchable-highlight {:style st/chat-name-btn-edit-container [touchable-highlight {:style st/chat-name-btn-edit-container
:on-press focus} :on-press focus}
[text {:style st/chat-name-btn-edit-text} (t :group-settings.edit)]])]]) [text {:style st/chat-name-btn-edit-text} (label :t/edit)]])]])
(defview group-settings [] (defview group-settings []
[show-color-picker [:group-settings :show-color-picker]] [show-color-picker [:group-settings :show-color-picker]]
@ -170,16 +170,16 @@
[new-group-toolbar] [new-group-toolbar]
[scroll-view st/body [scroll-view st/body
[chat-name] [chat-name]
[text {:style st/members-text} (t :members-title)] [text {:style st/members-text} (label :t/members-title)]
[touchable-highlight {:on-press #(dispatch [:navigate-to :add-participants])} [touchable-highlight {:on-press #(dispatch [:navigate-to :add-participants])}
;; TODO add participants view is not in design ;; TODO add participants view is not in design
[view st/add-members-container [view st/add-members-container
[icon :add-gray st/add-members-icon] [icon :add-gray st/add-members-icon]
[text {:style st/add-members-text} [text {:style st/add-members-text}
(t :group-settings.add-members)]]] (label :t/add-members)]]]
[chat-members] [chat-members]
[text {:style st/settings-text} [text {:style st/settings-text}
(t :settings.title)] (label :t/settings)]
[settings-view]] [settings-view]]
(when show-color-picker (when show-color-picker
[chat-color-picker]) [chat-color-picker])

View File

@ -8,7 +8,7 @@
touchable-highlight]] touchable-highlight]]
[status-im.resources :as res] [status-im.resources :as res]
[status-im.group-settings.styles.member :as st] [status-im.group-settings.styles.member :as st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn contact-photo [{:keys [photo-path]}] (defn contact-photo [{:keys [photo-path]}]
[view st/contact-photo-container [view st/contact-photo-container
@ -33,7 +33,7 @@
(if (pos? (count name)) (if (pos? (count name))
name name
;; todo is this correct behaviour? ;; todo is this correct behaviour?
(t :group-settings.no-name))] (label :t/no-name))]
;; TODO implement :role property for group chat contact ;; TODO implement :role property for group chat contact
(when role (when role
[text {:style st/role-text} [text {:style st/role-text}

View File

@ -4,10 +4,11 @@
(set! js/window.I18n (js/require "react-native-i18n")) (set! js/window.I18n (js/require "react-native-i18n"))
(set! (.-fallbacks js/I18n) true) (set! (.-fallbacks js/I18n) true)
(set! (.-defaultSeparator js/I18n) "/")
(set! (.-translations js.I18n) (clj->js {:en en/translations})) (set! (.-translations js.I18n) (clj->js {:en en/translations}))
(defn t [path & options] (defn label [path & options]
(.t js/I18n (name path) (clj->js options))) (.t js/I18n (name path) (clj->js options)))
(comment (comment

View File

@ -4,32 +4,32 @@
[re-frame.core :refer [subscribe dispatch]] [re-frame.core :refer [subscribe dispatch]]
[status-im.db :as db] [status-im.db :as db]
[status-im.components.styles :refer [color-blue color-dark-mint]] [status-im.components.styles :refer [color-blue color-dark-mint]]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
;; todo delete ;; todo delete
(def commands [{:command :money (def commands [{:command :money
:text "!money" :text "!money"
:description (t :commands.money.description) :description (label :t/money-command-description)
:color color-dark-mint :color color-dark-mint
:request-icon {:uri "icon_lock_white"} :request-icon {:uri "icon_lock_white"}
:icon {:uri "icon_lock_gray"} :icon {:uri "icon_lock_gray"}
:suggestion true} :suggestion true}
{:command :location {:command :location
:text "!location" :text "!location"
:description (t :commands.location.description) :description (label :t/location-command-description)
:color "#9a5dcf" :color "#9a5dcf"
:suggestion true} :suggestion true}
{:command :phone {:command :phone
:text "!phone" :text "!phone"
:description (t :commands.phone.description) :description (label :t/phone-command-description)
:color color-dark-mint :color color-dark-mint
:request-text (t :commands.phone.request-text) :request-text (label :t/phone-request-text)
:suggestion true :suggestion true
:handler #(dispatch [:sign-up %])} :handler #(dispatch [:sign-up %])}
{:command :confirmation-code {:command :confirmation-code
:text "!confirmationCode" :text "!confirmationCode"
:description (t :commands.confirmation-code.description) :description (label :t/confirmation-code-command-description)
:request-text (t :commands.confirmation-code.request-text) :request-text (label :t/confirmation-code-request-text)
:color color-blue :color color-blue
:request-icon {:uri "icon_lock_white"} :request-icon {:uri "icon_lock_white"}
:icon {:uri "icon_lock_gray"} :icon {:uri "icon_lock_gray"}
@ -37,17 +37,17 @@
:handler #(dispatch [:sign-up-confirm %])} :handler #(dispatch [:sign-up-confirm %])}
{:command :send {:command :send
:text "!send" :text "!send"
:description (t :commands.send.description) :description (label :t/send-command-description)
:color "#9a5dcf" :color "#9a5dcf"
:suggestion true} :suggestion true}
{:command :request {:command :request
:text "!request" :text "!request"
:description (t :commands.request.description) :description (label :t/request-command-description)
:color "#48ba30" :color "#48ba30"
:suggestion true} :suggestion true}
{:command :keypair-password {:command :keypair-password
:text "!keypair-password" :text "!keypair-password"
:description (t :commands.keypair-password.description) :description (label :t/keypair-password-command-description)
:color color-blue :color color-blue
:request-icon {:uri "icon_lock_white"} :request-icon {:uri "icon_lock_white"}
:icon {:uri "icon_lock_gray"} :icon {:uri "icon_lock_gray"}
@ -55,7 +55,7 @@
:handler #(dispatch [:save-password %])} :handler #(dispatch [:save-password %])}
{:command :help {:command :help
:text "!help" :text "!help"
:description (t :commands.help.description) :description (label :t/help-command-description)
:color "#9a5dcf" :color "#9a5dcf"
:suggestion true}]) :suggestion true}])

View File

@ -15,14 +15,14 @@
[status-im.utils.listview :refer [to-datasource]] [status-im.utils.listview :refer [to-datasource]]
[status-im.new-group.views.contact :refer [new-group-contact]] [status-im.new-group.views.contact :refer [new-group-contact]]
[status-im.new-group.styles :as st] [status-im.new-group.styles :as st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defview new-group-toolbar [] (defview new-group-toolbar []
[group-name [:get ::group-name] [group-name [:get ::group-name]
creation-disabled? [:get :disable-group-creation]] creation-disabled? [:get :disable-group-creation]]
[toolbar [toolbar
{:title (t :new-group.title) {:title (label :t/new-group-chat)
:action {:image {:source res/v ;; {:uri "icon_search"} :action {:image {:source res/v ;; {:uri "icon_search"}
:style st/toolbar-icon} :style st/toolbar-icon}
:handler (when-not creation-disabled? :handler (when-not creation-disabled?
@ -34,7 +34,7 @@
{:underlineColorAndroid color-purple {:underlineColorAndroid color-purple
:style st/group-name-input :style st/group-name-input
:autoFocus true :autoFocus true
:placeholder (t :new-group.group-name) :placeholder (label :t/group-name)
:onChangeText #(dispatch [:set ::group-name %])} :onChangeText #(dispatch [:set ::group-name %])}
group-name]) group-name])
@ -43,13 +43,13 @@
[view st/new-group-container [view st/new-group-container
[new-group-toolbar] [new-group-toolbar]
[view st/chat-name-container [view st/chat-name-container
[text {:style st/chat-name-text} (t :chat-name)] [text {:style st/chat-name-text} (label :t/chat-name)]
[group-name-input] [group-name-input]
[text {:style st/members-text} (t :members-title)] [text {:style st/members-text} (label :t/members-title)]
[touchable-highlight {:on-press (fn [])} [touchable-highlight {:on-press (fn [])}
[view st/add-container [view st/add-container
[icon :add_gray st/add-icon] [icon :add_gray st/add-icon]
[text {:style st/add-text} (t :group-settings.add-members)]]] [text {:style st/add-text} (label :t/add-members)]]]
[list-view [list-view
{:dataSource (to-datasource contacts) {:dataSource (to-datasource contacts)
:renderRow (fn [row _ _] :renderRow (fn [row _ _]

View File

@ -8,11 +8,11 @@
[status-im.participants.views.contact :refer [participant-contact]] [status-im.participants.views.contact :refer [participant-contact]]
[reagent.core :as r] [reagent.core :as r]
[status-im.participants.styles :as st] [status-im.participants.styles :as st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn new-participants-toolbar [] (defn new-participants-toolbar []
[toolbar [toolbar
{:title (t :participants.add) {:title (label :t/add-participants)
:action {:image {:source res/v ;; {:uri "icon_search"} :action {:image {:source res/v ;; {:uri "icon_search"}
:style st/new-participant-image} :style st/new-participant-image}
:handler #(do (dispatch [:add-new-participants]) :handler #(do (dispatch [:add-new-participants])

View File

@ -10,11 +10,12 @@
[status-im.participants.views.contact [status-im.participants.views.contact
:refer [participant-contact]] :refer [participant-contact]]
[reagent.core :as r] [reagent.core :as r]
[status-im.participants.styles :as st])) [status-im.participants.styles :as st]
[status-im.i18n :refer [label]]))
(defn remove-participants-toolbar [] (defn remove-participants-toolbar []
[toolbar [toolbar
{:title (t :participants.remove) {:title (label :t/remove-participants)
:action {:handler #(do (dispatch [:remove-participants]) :action {:handler #(do (dispatch [:remove-participants])
(dispatch [:navigate-back])) (dispatch [:navigate-back]))
:image {:source res/trash-icon ;; {:uri "icon_search"} :image {:source res/trash-icon ;; {:uri "icon_search"}

View File

@ -11,7 +11,7 @@
[status-im.components.chat-icon.screen :refer [profile-icon [status-im.components.chat-icon.screen :refer [profile-icon
my-profile-icon]] my-profile-icon]]
[status-im.profile.styles :as st] [status-im.profile.styles :as st]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(defn profile-property-view [{:keys [name value]}] (defn profile-property-view [{:keys [name value]}]
[view st/profile-property-view-container [view st/profile-property-view-container
@ -35,29 +35,29 @@
[profile-icon]] [profile-icon]]
[text {:style st/user-name} name] [text {:style st/user-name} name]
;; TODO stub data ;; TODO stub data
[text {:style st/status} (t :not-implemented)] [text {:style st/status} (label :t/not-implemented)]
[view st/btns-container [view st/btns-container
[touchable-highlight {:onPress #(message-user whisper-identity)} [touchable-highlight {:onPress #(message-user whisper-identity)}
[view st/message-btn [view st/message-btn
[text {:style st/message-btn-text} (t :profile.message)]]] [text {:style st/message-btn-text} (label :t/message)]]]
[touchable-highlight {:onPress (fn [] [touchable-highlight {:onPress (fn []
;; TODO not implemented ;; TODO not implemented
)} )}
[view st/more-btn [view st/more-btn
[icon :more_vertical_blue st/more-btn-image]]]]] [icon :more_vertical_blue st/more-btn-image]]]]]
[view st/profile-properties-container [view st/profile-properties-container
[profile-property-view {:name (t :profile.username) [profile-property-view {:name (label :t/username)
:value name}] :value name}]
[profile-property-view {:name (t :profile.phone-number) [profile-property-view {:name (label :t/phone-number)
:value phone-number}] :value phone-number}]
;; TODO stub data ;; TODO stub data
[profile-property-view {:name (t :profile.email) [profile-property-view {:name (label :t/email)
:value (t :not-implemented)}] :value (label :t/not-implemented)}]
[view st/report-user-container [view st/report-user-container
[touchable-highlight {:on-press (fn [] [touchable-highlight {:on-press (fn []
;; TODO not implemented ;; TODO not implemented
)} )}
[text {:style st/report-user-text} (t :profile.report-user)]]]]]) [text {:style st/report-user-text} (label :t/report-user)]]]]])
(defview my-profile [] (defview my-profile []
[username [:get :username] [username [:get :username]
@ -82,9 +82,9 @@
[text {:style st/user-name} username] [text {:style st/user-name} username]
[text {:style st/status} status]] [text {:style st/status} status]]
[view st/profile-properties-container [view st/profile-properties-container
[profile-property-view {:name (t :profile.username) [profile-property-view {:name (label :t/username)
:value username}] :value username}]
[profile-property-view {:name (t :profile.phone-number) [profile-property-view {:name (label :t/phone-number)
:value phone-number}] :value phone-number}]
[profile-property-view {:name (t :profile.email) [profile-property-view {:name (label :t/email)
:value email}]]]) :value email}]]])

View File

@ -13,7 +13,7 @@
[status-im.constants :refer [text-content-type]] [status-im.constants :refer [text-content-type]]
[status-im.models.messages :as messages] [status-im.models.messages :as messages]
[status-im.models.chats :as chats] [status-im.models.chats :as chats]
[status-im.i18n :refer [t]])) [status-im.i18n :refer [label]]))
(register-handler :initialize-protocol (register-handler :initialize-protocol
(u/side-effect! (u/side-effect!
@ -36,35 +36,35 @@
(let [contact-name (:name (contacts/contact-by-identity from))] (let [contact-name (:name (contacts/contact-by-identity from))]
(messages/save-message chat-id {:from "system" (messages/save-message chat-id {:from "system"
:msg-id (str msg-id "_" from) :msg-id (str msg-id "_" from)
:content (str (or contact-name from) " " (t :protocol.received-invitation)) :content (str (or contact-name from) " " (label :t/received-invitation))
:content-type text-content-type}))) :content-type text-content-type})))
(defn participant-invited-to-group-msg [chat-id identity from msg-id] (defn participant-invited-to-group-msg [chat-id identity from msg-id]
(let [inviter-name (:name (contacts/contact-by-identity from)) (let [inviter-name (:name (contacts/contact-by-identity from))
invitee-name (if (= identity (api/my-identity)) invitee-name (if (= identity (api/my-identity))
(t :You) (label :t/You)
(:name (contacts/contact-by-identity identity)))] (:name (contacts/contact-by-identity identity)))]
(messages/save-message chat-id {:from "system" (messages/save-message chat-id {:from "system"
:msg-id msg-id :msg-id msg-id
:content (str (or inviter-name from) " " (t :invited) " " (or invitee-name identity)) :content (str (or inviter-name from) " " (label :t/invited) " " (or invitee-name identity))
:content-type text-content-type}))) :content-type text-content-type})))
(defn participant-removed-from-group-msg [chat-id identity from msg-id] (defn participant-removed-from-group-msg [chat-id identity from msg-id]
(let [remover-name (:name (contacts/contact-by-identity from)) (let [remover-name (:name (contacts/contact-by-identity from))
removed-name (:name (contacts/contact-by-identity identity))] removed-name (:name (contacts/contact-by-identity identity))]
(->> (str (or remover-name from) " " (t :removed) " " (or removed-name identity)) (->> (str (or remover-name from) " " (label :t/removed) " " (or removed-name identity))
(system-message msg-id) (system-message msg-id)
(messages/save-message chat-id)))) (messages/save-message chat-id))))
(defn you-removed-from-group-msg [chat-id from msg-id] (defn you-removed-from-group-msg [chat-id from msg-id]
(let [remover-name (:name (contacts/contact-by-identity from))] (let [remover-name (:name (contacts/contact-by-identity from))]
(->> (str (or remover-name from) " " (t :protocol.removed-from-chat)) (->> (str (or remover-name from) " " (label :t/removed-from-chat))
(system-message msg-id) (system-message msg-id)
(messages/save-message chat-id)))) (messages/save-message chat-id))))
(defn participant-left-group-msg [chat-id from msg-id] (defn participant-left-group-msg [chat-id from msg-id]
(let [left-name (:name (contacts/contact-by-identity from))] (let [left-name (:name (contacts/contact-by-identity from))]
(->> (str (or left-name from) " " (t :left)) (->> (str (or left-name from) " " (label :t/left))
(system-message msg-id) (system-message msg-id)
(messages/save-message chat-id)))) (messages/save-message chat-id))))

View File

@ -1,89 +1,115 @@
(ns status-im.translations.en) (ns status-im.translations.en)
(def translations (def translations
{:chat {:is-typing "is typing" {
:and-you "and you" ;common
:members-title "Members"
:not-implemented "!not implemented"
:chat-name "Chat name"
:notifications-title "Notifications and sounds"
:search-chat "Search chat" ;drawer
:invite-friends "Invite friends"
:faq "FAQ"
:switch-users "Switch users"
:members {:one "1 member, 1 active" ;chat
:other "{{count}} members, {{count}} active"} :is-typing "is typing"
:last-active "Active a minute ago"} :and-you "and you"
:sign-up {:contacts-syncronized "Your contacts have been synchronized" :search-chat "Search chat"
:confirmation-code (str "Thanks! We've sent you a text message with a confirmation " :members {:one "1 member, 1 active"
"code. Please provide that code to confirm your phone number") :other "{{count}} members, {{count}} active"}
:password-saved (str "OK great! Your password has been saved. Just to let you " :last-active "Active a minute ago"
"know you can always change it in the Console by the way "
"it's me the Console nice to meet you!") ;profile
:generate-passphrase (str "I'll generate a passphrase for you so you can restore your " :profile "Profile"
"access or log in from another device") :report-user "REPORT USER"
:passphrase "Here's your passphrase:" :message "Message"
:written-down "Make sure you had securely written it down" :username "Username"
:phone-number-required (str "Your phone number is also required to use the app. Type the " :phone-number "Phone number"
"exclamation mark or hit the icon to open the command list " :email "Email"
"and choose the !phone command")
:intro-status (str "The brash businessmans braggadocio " ;sign-up
"and public exchange with candidates " :contacts-syncronized "Your contacts have been synchronized"
"in the US presidential election") :confirmation-code (str "Thanks! We've sent you a text message with a confirmation "
:intro-message1 "Hello there! It's Status a Dapp browser in your phone." "code. Please provide that code to confirm your phone number")
:intro-message2 (str "Status1 uses a highly secure key-pair authentication type " :password-saved (str "OK great! Your password has been saved. Just to let you "
"to provide you a reliable way to access your account") "know you can always change it in the Console by the way "
:keypair-generated (str "A key pair has been generated and saved to your device. " "it's me the Console nice to meet you!")
"Create a password to secure your key")} :generate-passphrase (str "I'll generate a passphrase for you so you can restore your "
:chats {:title "Chats" "access or log in from another device")
:new-chat "New Chat" :passphrase "Here's your passphrase:"
:new-group-chat "New Group Chat"} :written-down "Make sure you had securely written it down"
:profile {:title "Profile" :phone-number-required (str "Your phone number is also required to use the app. Type the "
:message "Message" "exclamation mark or hit the icon to open the command list "
:username "Username" "and choose the !phone command")
:phone-number "Phone number" :intro-status (str "The brash businessmans braggadocio "
:email "Email" "and public exchange with candidates "
:report-user "REPORT USER"} "in the US presidential election")
:settings {:title "Settings"} :intro-message1 "Hello there! It's Status a Dapp browser in your phone."
:discovery {:title "Discovery" :intro-message2 (str "Status1 uses a highly secure key-pair authentication type "
:none "None" "to provide you a reliable way to access your account")
:search-tags "Type your search tags here" :keypair-generated (str "A key pair has been generated and saved to your device. "
:popular-tags "Popular tags" "Create a password to secure your key")
:recent "Recent"}
:contacts {:title "Contacts" ;chats
:no-name "Noname"} :chats "Chats"
:invite-friends {:title "Invite friends"} :new-chat "New Chat"
:faq {:title "FAQ"} :new-group-chat "New Group Chat"
:drawer {:switch-users "Switch users"}
:group-settings {:no-name "Noname" ;discover
:remove "Remove" :discovery "Discovery"
:save "Save" :none "None"
:change-color "Change color" :search-tags "Type your search tags here"
:clear-history "Clear history" :popular-tags "Popular tags"
:delete-and-leave "Delete and leave" :recent "Recent"
:chat-settings "Chat settings"
:edit "Edit" ;settings
:add-members "Add Members"} :settings "Settings"
:new-group {:title "New Group Chat"
:group-name "Group Name"} ;contacts
:participants {:add "Add Participants" :contacts "Contacts"
:remove "Remove Participants"} :no-name "Noname"
:commands {:money {:description "Send money"}
:location {:description "Send location"} ;group-settings
:phone {:description "Send phone number" :remove "Remove"
:request-text "Phone number request"} :save "Save"
:confirmation-code {:description "Send confirmation code" :change-color "Change color"
:request-text "Confirmation code request"} :clear-history "Clear history"
:send {:description "Send location"} :delete-and-leave "Delete and leave"
:request {:description "Send request"} :chat-settings "Chat settings"
:keypair-password {:text:description ""} :edit "Edit"
:help {:description "Help"}} :add-members "Add Members"
:protocol {:received-invitation "received chat invitation" :blue "Blue"
:removed-from-chat "removed you from group chat"} :purple "Purple"
:colors {:blue "Blue" :green "Green"
:purple "Purple" :red "Red"
:green "Green"
:red "Red"} ;commands
:notifications {:title "Notifications and sounds"} :money-command-description "Send money"
:not-implemented "!not implemented" :location-command-description "Send location"
:chat-name "Chat name" :phone-command-description "Send phone number"
:members-title "Members" :phone-request-text "Phone number request"
:left "left" :confirmation-code-coomand-description "Send confirmation code"
:invited "invited" :confirmation-code-request-text "Confirmation code request"
:removed "removed" :send-command-description "Send location"
:You "You"}) :request-command-description "Send request"
:keypair-password-command-description ""
:help-command-description "Help"
;new-group
:group-name "Group Name"
;participants
:add-participants "Add Participants"
:remove-participants "Remove Participants"
;protocol
:received-invitation "received chat invitation"
:removed-from-chat "removed you from group chat"
:left "left"
:invited "invited"
:removed "removed"
:You "You"
})