parent
c64b157666
commit
67e784598a
|
@ -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 [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
|
||||
(defn contacts-by-identity [contacts]
|
||||
|
@ -47,7 +47,7 @@
|
|||
[view st/typing-view
|
||||
[view st/typing-background
|
||||
[text {:style st/typing-text}
|
||||
(str member " " (t :chat.is-typing))]]])
|
||||
(str member " " (label :t/is-typing))]]])
|
||||
|
||||
(defn typing-all []
|
||||
[view st/typing-all
|
||||
|
@ -101,63 +101,63 @@
|
|||
[chat-icon-view-menu-item chat-id group-chat name color true])
|
||||
|
||||
(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 []
|
||||
(let [{:keys [group-chat chat-id]}
|
||||
(subscribe [:chat-properties [:group-chat :chat-id]])
|
||||
members (subscribe [:current-chat-contacts])]
|
||||
(when-let [actions (if @group-chat
|
||||
[{:title (t :members-title)
|
||||
[{:title (label :t/members-title)
|
||||
:subtitle (members-text @members)
|
||||
:icon :menu_group
|
||||
:icon-style {:width 25
|
||||
:height 19}
|
||||
;; TODO not implemented: action Members
|
||||
:handler nil}
|
||||
{:title (t :chat.search-chat)
|
||||
:subtitle (t :not-implemented)
|
||||
{:title (label :t/search-chat)
|
||||
:subtitle (label :t/not-implemented)
|
||||
:icon :search_gray_copy
|
||||
:icon-style {:width 17
|
||||
:height 17}
|
||||
;; TODO not implemented: action Search chat
|
||||
:handler nil}
|
||||
{:title (t :notifications.title)
|
||||
:subtitle (t :not-implemented)
|
||||
{:title (label :t/notifications-title)
|
||||
:subtitle (label :t/not-implemented)
|
||||
;;:subtitle "Chat muted"
|
||||
:icon :muted
|
||||
:icon-style {:width 18
|
||||
:height 21}
|
||||
;; TODO not implemented: action Notifications
|
||||
:handler nil}
|
||||
{:title (t :settings.title)
|
||||
{:title (label :t/settings)
|
||||
:icon :settings
|
||||
:icon-style {:width 20
|
||||
:height 13}
|
||||
:handler #(dispatch [:show-group-settings])}]
|
||||
[{:title (t :profile.title)
|
||||
[{:title (label :t/profile)
|
||||
:custom-icon [menu-item-icon-profile]
|
||||
:icon :menu_group
|
||||
:icon-style {:width 25
|
||||
:height 19}
|
||||
:handler #(dispatch [:show-profile @chat-id])}
|
||||
{:title (t :chat.search-chat)
|
||||
:subtitle (t :not-implemented)
|
||||
{:title (label :t/search-chat)
|
||||
:subtitle (label :t/not-implemented)
|
||||
:icon :search_gray_copy
|
||||
:icon-style {:width 17
|
||||
:height 17}
|
||||
;; TODO not implemented: action Search chat
|
||||
:handler nil}
|
||||
{:title (t :notifications.title)
|
||||
:subtitle (t :not-implemented)
|
||||
{:title (label :t/notifications-title)
|
||||
:subtitle (label :t/not-implemented)
|
||||
;;:subtitle "Notifications on"
|
||||
:icon :muted
|
||||
:icon-style {:width 18
|
||||
:height 21}
|
||||
;; TODO not implemented: action Notifications
|
||||
:handler nil}
|
||||
{:title (t :settings.title)
|
||||
:subtitle (t :not-implemented)
|
||||
{:title (label :t/settings)
|
||||
:subtitle (label :t/not-implemented)
|
||||
:icon :settings
|
||||
:icon-style {:width 20
|
||||
:height 13}
|
||||
|
@ -180,15 +180,15 @@
|
|||
(fn []
|
||||
[view (st/chat-name-view @show-actions)
|
||||
[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
|
||||
[view {:flexDirection :row}
|
||||
[icon :group st/group-icon]
|
||||
[text {:style st/members}
|
||||
(let [cnt (inc (count @contacts))]
|
||||
(t :chat.members {:count cnt}))]]
|
||||
(label :t/members {:count cnt}))]]
|
||||
;; 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 []
|
||||
(let [show-actions (subscribe [:show-actions])]
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
content-type-command
|
||||
content-type-command-request
|
||||
content-type-status]]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn send-console-msg [text]
|
||||
{:msg-id (random/id)
|
||||
|
@ -33,7 +33,7 @@
|
|||
(defn on-sync-contacts []
|
||||
(dispatch [:received-msg
|
||||
{:msg-id (random/id)
|
||||
:content (t :sign-up.contacts-syncronized)
|
||||
:content (label :t/contacts-syncronized)
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
|
@ -71,7 +71,7 @@
|
|||
{:msg-id msg-id
|
||||
:content (command-content
|
||||
:confirmation-code
|
||||
(t :sign-up.confirmation-code))
|
||||
(label :t/confirmation-code))
|
||||
:content-type content-type-command-request
|
||||
:outgoing false
|
||||
:from "console"
|
||||
|
@ -95,21 +95,21 @@
|
|||
;; TODO validate and save password
|
||||
(dispatch [:received-msg
|
||||
{:msg-id (random/id)
|
||||
:content (t :sign-up.password-saved)
|
||||
:content (label :t/password-saved)
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
:to "me"}])
|
||||
(dispatch [:received-msg
|
||||
{:msg-id (random/id)
|
||||
:content (t :sign-up.generate-passphrase)
|
||||
:content (label :t/generate-passphrase)
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
:to "me"}])
|
||||
(dispatch [:received-msg
|
||||
{:msg-id (random/id)
|
||||
:content (t :sign-up.passphrase)
|
||||
:content (label :t/passphrase)
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
|
@ -126,7 +126,7 @@
|
|||
:to "me"}]))
|
||||
(dispatch [:received-msg
|
||||
{:msg-id "8"
|
||||
:content (t :sign-up.written-down)
|
||||
:content (label :t/written-down)
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
|
@ -137,7 +137,7 @@
|
|||
{:msg-id msg-id
|
||||
:content (command-content
|
||||
:phone
|
||||
(t :sign-up.phone-number-required))
|
||||
(label :t/phone-number-required))
|
||||
:content-type content-type-command-request
|
||||
:outgoing false
|
||||
:from "console"
|
||||
|
@ -145,7 +145,7 @@
|
|||
|
||||
(def intro-status
|
||||
{:msg-id "intro-status"
|
||||
:content (t :sign-up.intro-status)
|
||||
:content (label :t/intro-status)
|
||||
:delivery-status "seen"
|
||||
:from "console"
|
||||
:chat-id "console"
|
||||
|
@ -157,14 +157,14 @@
|
|||
(dispatch [:received-msg intro-status])
|
||||
(dispatch [:received-msg
|
||||
{:msg-id "intro-message1"
|
||||
:content (t :sign-up.intro-message1)
|
||||
:content (label :t/intro-message1)
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
:to "me"}])
|
||||
(dispatch [:received-msg
|
||||
{:msg-id "intro-message2"
|
||||
:content (t :sign-up.intro-message2)
|
||||
:content (label :t/intro-message2)
|
||||
:content-type text-content-type
|
||||
:outgoing false
|
||||
:from "console"
|
||||
|
@ -174,7 +174,7 @@
|
|||
{:msg-id msg-id
|
||||
:content (command-content
|
||||
:keypair-password
|
||||
(t :sign-up.keypair-generated))
|
||||
(label :t/keypair-generated))
|
||||
:content-type content-type-command-request
|
||||
:outgoing false
|
||||
:from "console"
|
||||
|
|
|
@ -16,14 +16,14 @@
|
|||
toolbar-background2]]
|
||||
[status-im.components.toolbar :refer [toolbar]]
|
||||
[status-im.components.icons.ionicons :refer [icon]]
|
||||
[status-im.i18n :refer [t]]
|
||||
[status-im.i18n :refer [label]]
|
||||
[status-im.chats-list.styles :as st]))
|
||||
|
||||
(defn chats-list-toolbar []
|
||||
[toolbar {:nav-action {:image {:source {:uri :icon_hamburger}
|
||||
:style st/hamburger-icon}
|
||||
:handler open-drawer}
|
||||
:title (t :chats.title)
|
||||
:title (label :t/chats)
|
||||
:background-color toolbar-background2
|
||||
;; TODO implement search
|
||||
:action {:image {:source {:uri :icon_search}
|
||||
|
@ -44,13 +44,13 @@
|
|||
:offsetY 16
|
||||
:offsetX 16}
|
||||
[action-button-item
|
||||
{:title (t :chats.new-chat)
|
||||
{:title (label :t/new-chat)
|
||||
:buttonColor :#9b59b6
|
||||
:onPress #(dispatch [:navigate-to :contact-list])}
|
||||
[icon {:name :android-create
|
||||
:style st/create-icon}]]
|
||||
[action-button-item
|
||||
{:title (t :chats.new-group-chat)
|
||||
{:title (label :t/new-group-chat)
|
||||
:buttonColor :#1abc9c
|
||||
:onPress #(dispatch [:show-group-new])}
|
||||
[icon {:name :person-stalker
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
touchable-opacity]]
|
||||
[status-im.resources :as res]
|
||||
[status-im.components.drawer.styles :as st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defonce drawer-atom (atom))
|
||||
|
||||
|
@ -46,21 +46,21 @@
|
|||
[text {:style st/name-text}
|
||||
@username]]
|
||||
[view st/menu-items-container
|
||||
[menu-item {:name (t :profile.title)
|
||||
[menu-item {:name (label :t/profile)
|
||||
:handler #(dispatch [:navigate-to :my-profile])}]
|
||||
[menu-item {:name (t :settings.title)
|
||||
[menu-item {:name (label :t/settings)
|
||||
:handler (fn []
|
||||
;; TODO not implemented
|
||||
)}]
|
||||
[menu-item {:name (t :discovery.title)
|
||||
[menu-item {:name (label :t/discovery)
|
||||
:handler #(dispatch [:navigate-to :discovery])}]
|
||||
[menu-item {:name (t :contacts.title)
|
||||
[menu-item {:name (label :t/contacts)
|
||||
:handler #(dispatch [:show-contacts navigator])}]
|
||||
[menu-item {:name (t :invite-friends.title)
|
||||
[menu-item {:name (label :t/invite-friends)
|
||||
:handler (fn []
|
||||
;; TODO not implemented
|
||||
)}]
|
||||
[menu-item {:name (t :faq.title)
|
||||
[menu-item {:name (label :t/faq)
|
||||
:handler (fn [])}]]
|
||||
[view st/switch-users-container
|
||||
[touchable-opacity {:onPress (fn []
|
||||
|
@ -68,7 +68,7 @@
|
|||
;; TODO not implemented
|
||||
)}
|
||||
[text {:style st/switch-users-text}
|
||||
(t :drawer.switch-users)]]]])))
|
||||
(label :t/switch-users)]]]])))
|
||||
|
||||
(defn drawer-view [items]
|
||||
[drawer-layout-android {:drawerWidth 260
|
||||
|
|
|
@ -12,19 +12,19 @@
|
|||
[status-im.components.tabs.tabs :refer [tabs]]
|
||||
[status-im.components.tabs.styles :as st]
|
||||
[status-im.components.styles :as common-st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(def tab-list
|
||||
[{:view-id :chat-list
|
||||
:title (t :chats.title)
|
||||
:title (label :t/chats)
|
||||
:screen chats-list
|
||||
:icon :icon_tab_chats}
|
||||
{:view-id :discovery
|
||||
:title (t :discovery.title)
|
||||
:title (label :t/discovery)
|
||||
:screen discovery
|
||||
:icon :icon_tab_discovery}
|
||||
{:view-id :contact-list
|
||||
:title (t :contacts.title)
|
||||
:title (label :t/contacts)
|
||||
:screen contact-list
|
||||
:icon :icon_tab_contacts}])
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
[status-im.components.toolbar :refer [toolbar]]
|
||||
[status-im.contacts.styles :as st]
|
||||
[status-im.utils.listview :as lw]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn render-row [row _ _]
|
||||
(list-item [contact-view row]))
|
||||
|
||||
(defn contact-list-toolbar []
|
||||
[toolbar {:title (t :contacts.title)
|
||||
[toolbar {:title (label :t/contacts)
|
||||
:background-color toolbar-background2
|
||||
:action {:image {:source {:uri :icon_search}
|
||||
:style st/search-icon}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
[status-im.components.react :refer [view image text]]
|
||||
[status-im.resources :as res]
|
||||
[status-im.contacts.styles :as st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn contact-photo [{:keys [photo-path]}]
|
||||
[view st/contact-photo-container
|
||||
|
@ -28,4 +28,4 @@
|
|||
(if (pos? (count name))
|
||||
name
|
||||
;; todo is this correct behaviour?
|
||||
(t :contacts.no-name))]]])
|
||||
(label :t/no-name))]]])
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
[status-im.discovery.views.popular :refer [popular]]
|
||||
[status-im.discovery.views.recent :refer [discovery-recent]]
|
||||
[status-im.discovery.styles :as st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn get-hashtags [status]
|
||||
(let [hashtags (map #(subs % 1) (re-seq #"#[^ !?,;:.]+" status))]
|
||||
|
@ -21,13 +21,13 @@
|
|||
(if show-search
|
||||
[text-input {:style st/discovery-search-input
|
||||
:autoFocus true
|
||||
:placeholder (t :discovery.search-tags)
|
||||
:placeholder (label :t/search-tags)
|
||||
:onSubmitEditing (fn [e]
|
||||
(let [search (aget e "nativeEvent" "text")
|
||||
hashtags (get-hashtags search)]
|
||||
(dispatch [:broadcast-status search hashtags])))}]
|
||||
[view
|
||||
[text {:style st/discovery-title} (t :discovery.title)]])])
|
||||
[text {:style st/discovery-title} (label :t/discovery)]])])
|
||||
|
||||
(defn toogle-search [current-value]
|
||||
(dispatch [:set ::show-search (not current-value)]))
|
||||
|
@ -46,8 +46,8 @@
|
|||
:handler #(toogle-search show-search)}}]
|
||||
[scroll-view st/scroll-view-container
|
||||
[view st/section-spacing
|
||||
[text {:style st/discovery-subtitle} (t :discovery.popular-tags)]]
|
||||
[text {:style st/discovery-subtitle} (label :t/popular-tags)]]
|
||||
[popular]
|
||||
[view st/section-spacing
|
||||
[text {:style st/discovery-subtitle} (t :discovery.recent)]]
|
||||
[text {:style st/discovery-subtitle} (label :t/recent)]]
|
||||
[discovery-recent]]])
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
[status-im.components.carousel.carousel :refer [carousel]]
|
||||
[status-im.discovery.styles :as st]
|
||||
[status-im.discovery.views.popular-list :refer [discovery-popular-list]]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn page-width []
|
||||
(.-width (.get (.. js/React -Dimensions) "window")))
|
||||
|
@ -20,4 +20,4 @@
|
|||
:sneak 20}
|
||||
(for [{:keys [name count]} popular-tags]
|
||||
[discovery-popular-list name count])]
|
||||
[text (t :discovery.none)]))
|
||||
[text (label :t/none)]))
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
[status-im.components.chat-icon.screen :refer [chat-icon-view-action]]
|
||||
[status-im.group-settings.styles.group-settings :as st]
|
||||
[status-im.group-settings.views.member :refer [member-view]]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn remove-member []
|
||||
(dispatch [:remove-participants]))
|
||||
|
@ -36,7 +36,7 @@
|
|||
[text {:style st/modal-member-name} name]
|
||||
[touchable-highlight {:on-press remove-member}
|
||||
[text {:style st/modal-remove-text}
|
||||
(t :group-settings.remove)]]]]]))
|
||||
(label :t/remove)]]]]]))
|
||||
|
||||
(defview chat-members []
|
||||
[members [:current-chat-contacts]]
|
||||
|
@ -76,13 +76,13 @@
|
|||
[view st/modal-color-picker-inner-container
|
||||
[picker {:selectedValue new-color
|
||||
:onValueChange #(dispatch [:set :new-chat-color %])}
|
||||
[picker-item {:label (t :colors.blue) :value "#7099e6"}]
|
||||
[picker-item {:label (t :colors.purple) :value "#a187d5"}]
|
||||
[picker-item {:label (t :colors.green) :value "green"}]
|
||||
[picker-item {:label (t :colors.red) :value "red"}]]
|
||||
[picker-item {:label (label :t/blue) :value "#7099e6"}]
|
||||
[picker-item {:label (label :t/purple) :value "#a187d5"}]
|
||||
[picker-item {:label (label :t/green) :value "green"}]
|
||||
[picker-item {:label (label :t/red) :value "red"}]]
|
||||
[touchable-highlight {:on-press set-chat-color}
|
||||
[text {:style st/modal-color-picker-save-btn-text}
|
||||
(t :group-settings.save)]]]]])
|
||||
(label :t/save)]]]]])
|
||||
|
||||
(defview chat-color-icon []
|
||||
[chat-color [:chat :color]]
|
||||
|
@ -93,11 +93,11 @@
|
|||
|
||||
(defn settings-view []
|
||||
(let [settings [{:custom-icon [chat-color-icon]
|
||||
:title (t :group-settings.change-color)
|
||||
:title (label :t/change-color)
|
||||
:handler show-chat-color-picker}
|
||||
;; TODO not implemented: Notifications
|
||||
(merge {:title (t :notifications.title)
|
||||
:subtitle (t :not-implemented)
|
||||
(merge {:title (label :t/notifications-title)
|
||||
:subtitle (label :t/not-implemented)
|
||||
:handler nil}
|
||||
(if true
|
||||
{:icon :notifications-on
|
||||
|
@ -109,13 +109,13 @@
|
|||
{:icon :close-gray
|
||||
:icon-style {:width 12
|
||||
:height 12}
|
||||
:title (t :group-settings.clear-history)
|
||||
:title (label :t/clear-history)
|
||||
;; TODO show confirmation dialog?
|
||||
:handler #(dispatch [:clear-history])}
|
||||
{:icon :bin
|
||||
:icon-style {:width 12
|
||||
:height 18}
|
||||
:title (t :group-settings.delete-and-leave)
|
||||
:title (label :t/delete-and-leave)
|
||||
;; TODO show confirmation dialog?
|
||||
:handler #(dispatch [:leave-group-chat])}]]
|
||||
[view st/settings-container
|
||||
|
@ -131,7 +131,7 @@
|
|||
[chat-icon-view-action chat-id group-chat name color false]])
|
||||
|
||||
(defn new-group-toolbar []
|
||||
[toolbar {:title (t :group-settings.chat-settings)
|
||||
[toolbar {:title (label :t/chat-settings)
|
||||
:custom-action [chat-icon]}])
|
||||
|
||||
(defn focus []
|
||||
|
@ -148,7 +148,7 @@
|
|||
new-name [:get :new-chat-name]
|
||||
focused? [:get ::name-input-focused]]
|
||||
[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?)
|
||||
[text-input {:style st/chat-name-value
|
||||
:ref #(when (and % focused?) (.focus %))
|
||||
|
@ -162,7 +162,7 @@
|
|||
[view [icon :ok-purple st/add-members-icon]]]
|
||||
[touchable-highlight {:style st/chat-name-btn-edit-container
|
||||
: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 []
|
||||
[show-color-picker [:group-settings :show-color-picker]]
|
||||
|
@ -170,16 +170,16 @@
|
|||
[new-group-toolbar]
|
||||
[scroll-view st/body
|
||||
[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])}
|
||||
;; TODO add participants view is not in design
|
||||
[view st/add-members-container
|
||||
[icon :add-gray st/add-members-icon]
|
||||
[text {:style st/add-members-text}
|
||||
(t :group-settings.add-members)]]]
|
||||
(label :t/add-members)]]]
|
||||
[chat-members]
|
||||
[text {:style st/settings-text}
|
||||
(t :settings.title)]
|
||||
(label :t/settings)]
|
||||
[settings-view]]
|
||||
(when show-color-picker
|
||||
[chat-color-picker])
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
touchable-highlight]]
|
||||
[status-im.resources :as res]
|
||||
[status-im.group-settings.styles.member :as st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn contact-photo [{:keys [photo-path]}]
|
||||
[view st/contact-photo-container
|
||||
|
@ -33,7 +33,7 @@
|
|||
(if (pos? (count name))
|
||||
name
|
||||
;; todo is this correct behaviour?
|
||||
(t :group-settings.no-name))]
|
||||
(label :t/no-name))]
|
||||
;; TODO implement :role property for group chat contact
|
||||
(when role
|
||||
[text {:style st/role-text}
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
|
||||
(set! js/window.I18n (js/require "react-native-i18n"))
|
||||
(set! (.-fallbacks js/I18n) true)
|
||||
(set! (.-defaultSeparator js/I18n) "/")
|
||||
|
||||
(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)))
|
||||
|
||||
(comment
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
[re-frame.core :refer [subscribe dispatch]]
|
||||
[status-im.db :as db]
|
||||
[status-im.components.styles :refer [color-blue color-dark-mint]]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
;; todo delete
|
||||
(def commands [{:command :money
|
||||
:text "!money"
|
||||
:description (t :commands.money.description)
|
||||
:description (label :t/money-command-description)
|
||||
:color color-dark-mint
|
||||
:request-icon {:uri "icon_lock_white"}
|
||||
:icon {:uri "icon_lock_gray"}
|
||||
:suggestion true}
|
||||
{:command :location
|
||||
:text "!location"
|
||||
:description (t :commands.location.description)
|
||||
:description (label :t/location-command-description)
|
||||
:color "#9a5dcf"
|
||||
:suggestion true}
|
||||
{:command :phone
|
||||
:text "!phone"
|
||||
:description (t :commands.phone.description)
|
||||
:description (label :t/phone-command-description)
|
||||
:color color-dark-mint
|
||||
:request-text (t :commands.phone.request-text)
|
||||
:request-text (label :t/phone-request-text)
|
||||
:suggestion true
|
||||
:handler #(dispatch [:sign-up %])}
|
||||
{:command :confirmation-code
|
||||
:text "!confirmationCode"
|
||||
:description (t :commands.confirmation-code.description)
|
||||
:request-text (t :commands.confirmation-code.request-text)
|
||||
:description (label :t/confirmation-code-command-description)
|
||||
:request-text (label :t/confirmation-code-request-text)
|
||||
:color color-blue
|
||||
:request-icon {:uri "icon_lock_white"}
|
||||
:icon {:uri "icon_lock_gray"}
|
||||
|
@ -37,17 +37,17 @@
|
|||
:handler #(dispatch [:sign-up-confirm %])}
|
||||
{:command :send
|
||||
:text "!send"
|
||||
:description (t :commands.send.description)
|
||||
:description (label :t/send-command-description)
|
||||
:color "#9a5dcf"
|
||||
:suggestion true}
|
||||
{:command :request
|
||||
:text "!request"
|
||||
:description (t :commands.request.description)
|
||||
:description (label :t/request-command-description)
|
||||
:color "#48ba30"
|
||||
:suggestion true}
|
||||
{:command :keypair-password
|
||||
:text "!keypair-password"
|
||||
:description (t :commands.keypair-password.description)
|
||||
:description (label :t/keypair-password-command-description)
|
||||
:color color-blue
|
||||
:request-icon {:uri "icon_lock_white"}
|
||||
:icon {:uri "icon_lock_gray"}
|
||||
|
@ -55,7 +55,7 @@
|
|||
:handler #(dispatch [:save-password %])}
|
||||
{:command :help
|
||||
:text "!help"
|
||||
:description (t :commands.help.description)
|
||||
:description (label :t/help-command-description)
|
||||
:color "#9a5dcf"
|
||||
:suggestion true}])
|
||||
|
||||
|
|
|
@ -15,14 +15,14 @@
|
|||
[status-im.utils.listview :refer [to-datasource]]
|
||||
[status-im.new-group.views.contact :refer [new-group-contact]]
|
||||
[status-im.new-group.styles :as st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
|
||||
(defview new-group-toolbar []
|
||||
[group-name [:get ::group-name]
|
||||
creation-disabled? [:get :disable-group-creation]]
|
||||
[toolbar
|
||||
{:title (t :new-group.title)
|
||||
{:title (label :t/new-group-chat)
|
||||
:action {:image {:source res/v ;; {:uri "icon_search"}
|
||||
:style st/toolbar-icon}
|
||||
:handler (when-not creation-disabled?
|
||||
|
@ -34,7 +34,7 @@
|
|||
{:underlineColorAndroid color-purple
|
||||
:style st/group-name-input
|
||||
:autoFocus true
|
||||
:placeholder (t :new-group.group-name)
|
||||
:placeholder (label :t/group-name)
|
||||
:onChangeText #(dispatch [:set ::group-name %])}
|
||||
group-name])
|
||||
|
||||
|
@ -43,13 +43,13 @@
|
|||
[view st/new-group-container
|
||||
[new-group-toolbar]
|
||||
[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]
|
||||
[text {:style st/members-text} (t :members-title)]
|
||||
[text {:style st/members-text} (label :t/members-title)]
|
||||
[touchable-highlight {:on-press (fn [])}
|
||||
[view st/add-container
|
||||
[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
|
||||
{:dataSource (to-datasource contacts)
|
||||
:renderRow (fn [row _ _]
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
[status-im.participants.views.contact :refer [participant-contact]]
|
||||
[reagent.core :as r]
|
||||
[status-im.participants.styles :as st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn new-participants-toolbar []
|
||||
[toolbar
|
||||
{:title (t :participants.add)
|
||||
{:title (label :t/add-participants)
|
||||
:action {:image {:source res/v ;; {:uri "icon_search"}
|
||||
:style st/new-participant-image}
|
||||
:handler #(do (dispatch [:add-new-participants])
|
||||
|
|
|
@ -10,11 +10,12 @@
|
|||
[status-im.participants.views.contact
|
||||
:refer [participant-contact]]
|
||||
[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 []
|
||||
[toolbar
|
||||
{:title (t :participants.remove)
|
||||
{:title (label :t/remove-participants)
|
||||
:action {:handler #(do (dispatch [:remove-participants])
|
||||
(dispatch [:navigate-back]))
|
||||
:image {:source res/trash-icon ;; {:uri "icon_search"}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
[status-im.components.chat-icon.screen :refer [profile-icon
|
||||
my-profile-icon]]
|
||||
[status-im.profile.styles :as st]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(defn profile-property-view [{:keys [name value]}]
|
||||
[view st/profile-property-view-container
|
||||
|
@ -35,29 +35,29 @@
|
|||
[profile-icon]]
|
||||
[text {:style st/user-name} name]
|
||||
;; TODO stub data
|
||||
[text {:style st/status} (t :not-implemented)]
|
||||
[text {:style st/status} (label :t/not-implemented)]
|
||||
[view st/btns-container
|
||||
[touchable-highlight {:onPress #(message-user whisper-identity)}
|
||||
[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 []
|
||||
;; TODO not implemented
|
||||
)}
|
||||
[view st/more-btn
|
||||
[icon :more_vertical_blue st/more-btn-image]]]]]
|
||||
[view st/profile-properties-container
|
||||
[profile-property-view {:name (t :profile.username)
|
||||
[profile-property-view {:name (label :t/username)
|
||||
:value name}]
|
||||
[profile-property-view {:name (t :profile.phone-number)
|
||||
[profile-property-view {:name (label :t/phone-number)
|
||||
:value phone-number}]
|
||||
;; TODO stub data
|
||||
[profile-property-view {:name (t :profile.email)
|
||||
:value (t :not-implemented)}]
|
||||
[profile-property-view {:name (label :t/email)
|
||||
:value (label :t/not-implemented)}]
|
||||
[view st/report-user-container
|
||||
[touchable-highlight {:on-press (fn []
|
||||
;; 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 []
|
||||
[username [:get :username]
|
||||
|
@ -82,9 +82,9 @@
|
|||
[text {:style st/user-name} username]
|
||||
[text {:style st/status} status]]
|
||||
[view st/profile-properties-container
|
||||
[profile-property-view {:name (t :profile.username)
|
||||
[profile-property-view {:name (label :t/username)
|
||||
:value username}]
|
||||
[profile-property-view {:name (t :profile.phone-number)
|
||||
[profile-property-view {:name (label :t/phone-number)
|
||||
:value phone-number}]
|
||||
[profile-property-view {:name (t :profile.email)
|
||||
[profile-property-view {:name (label :t/email)
|
||||
:value email}]]])
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
[status-im.constants :refer [text-content-type]]
|
||||
[status-im.models.messages :as messages]
|
||||
[status-im.models.chats :as chats]
|
||||
[status-im.i18n :refer [t]]))
|
||||
[status-im.i18n :refer [label]]))
|
||||
|
||||
(register-handler :initialize-protocol
|
||||
(u/side-effect!
|
||||
|
@ -36,35 +36,35 @@
|
|||
(let [contact-name (:name (contacts/contact-by-identity from))]
|
||||
(messages/save-message chat-id {:from "system"
|
||||
: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})))
|
||||
|
||||
(defn participant-invited-to-group-msg [chat-id identity from msg-id]
|
||||
(let [inviter-name (:name (contacts/contact-by-identity from))
|
||||
invitee-name (if (= identity (api/my-identity))
|
||||
(t :You)
|
||||
(label :t/You)
|
||||
(:name (contacts/contact-by-identity identity)))]
|
||||
(messages/save-message chat-id {:from "system"
|
||||
: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})))
|
||||
|
||||
(defn participant-removed-from-group-msg [chat-id identity from msg-id]
|
||||
(let [remover-name (:name (contacts/contact-by-identity from))
|
||||
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)
|
||||
(messages/save-message chat-id))))
|
||||
|
||||
(defn you-removed-from-group-msg [chat-id from msg-id]
|
||||
(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)
|
||||
(messages/save-message chat-id))))
|
||||
|
||||
(defn participant-left-group-msg [chat-id from msg-id]
|
||||
(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)
|
||||
(messages/save-message chat-id))))
|
||||
|
||||
|
|
|
@ -1,89 +1,115 @@
|
|||
(ns status-im.translations.en)
|
||||
|
||||
(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"
|
||||
:other "{{count}} members, {{count}} active"}
|
||||
:last-active "Active a minute ago"}
|
||||
:sign-up {:contacts-syncronized "Your contacts have been synchronized"
|
||||
:confirmation-code (str "Thanks! We've sent you a text message with a confirmation "
|
||||
"code. Please provide that code to confirm your phone number")
|
||||
:password-saved (str "OK great! Your password has been saved. Just to let you "
|
||||
"know you can always change it in the Console by the way "
|
||||
"it's me the Console nice to meet you!")
|
||||
:generate-passphrase (str "I'll generate a passphrase for you so you can restore your "
|
||||
"access or log in from another device")
|
||||
:passphrase "Here's your passphrase:"
|
||||
:written-down "Make sure you had securely written it down"
|
||||
:phone-number-required (str "Your phone number is also required to use the app. Type the "
|
||||
"exclamation mark or hit the icon to open the command list "
|
||||
"and choose the !phone command")
|
||||
:intro-status (str "The brash businessman’s braggadocio "
|
||||
"and public exchange with candidates "
|
||||
"in the US presidential election")
|
||||
:intro-message1 "Hello there! It's Status a Dapp browser in your phone."
|
||||
:intro-message2 (str "Status1 uses a highly secure key-pair authentication type "
|
||||
"to provide you a reliable way to access your account")
|
||||
:keypair-generated (str "A key pair has been generated and saved to your device. "
|
||||
"Create a password to secure your key")}
|
||||
:chats {:title "Chats"
|
||||
:new-chat "New Chat"
|
||||
:new-group-chat "New Group Chat"}
|
||||
:profile {:title "Profile"
|
||||
:message "Message"
|
||||
:username "Username"
|
||||
:phone-number "Phone number"
|
||||
:email "Email"
|
||||
:report-user "REPORT USER"}
|
||||
:settings {:title "Settings"}
|
||||
:discovery {:title "Discovery"
|
||||
:none "None"
|
||||
:search-tags "Type your search tags here"
|
||||
:popular-tags "Popular tags"
|
||||
:recent "Recent"}
|
||||
:contacts {:title "Contacts"
|
||||
:no-name "Noname"}
|
||||
:invite-friends {:title "Invite friends"}
|
||||
:faq {:title "FAQ"}
|
||||
:drawer {:switch-users "Switch users"}
|
||||
:group-settings {:no-name "Noname"
|
||||
:remove "Remove"
|
||||
:save "Save"
|
||||
:change-color "Change color"
|
||||
:clear-history "Clear history"
|
||||
:delete-and-leave "Delete and leave"
|
||||
:chat-settings "Chat settings"
|
||||
:edit "Edit"
|
||||
:add-members "Add Members"}
|
||||
:new-group {:title "New Group Chat"
|
||||
:group-name "Group Name"}
|
||||
:participants {:add "Add Participants"
|
||||
:remove "Remove Participants"}
|
||||
:commands {:money {:description "Send money"}
|
||||
:location {:description "Send location"}
|
||||
:phone {:description "Send phone number"
|
||||
:request-text "Phone number request"}
|
||||
:confirmation-code {:description "Send confirmation code"
|
||||
:request-text "Confirmation code request"}
|
||||
:send {:description "Send location"}
|
||||
:request {:description "Send request"}
|
||||
:keypair-password {:text:description ""}
|
||||
:help {:description "Help"}}
|
||||
:protocol {:received-invitation "received chat invitation"
|
||||
:removed-from-chat "removed you from group chat"}
|
||||
:colors {:blue "Blue"
|
||||
:purple "Purple"
|
||||
:green "Green"
|
||||
:red "Red"}
|
||||
:notifications {:title "Notifications and sounds"}
|
||||
:not-implemented "!not implemented"
|
||||
:chat-name "Chat name"
|
||||
:members-title "Members"
|
||||
:left "left"
|
||||
:invited "invited"
|
||||
:removed "removed"
|
||||
:You "You"})
|
||||
;chat
|
||||
:is-typing "is typing"
|
||||
:and-you "and you"
|
||||
:search-chat "Search chat"
|
||||
:members {:one "1 member, 1 active"
|
||||
:other "{{count}} members, {{count}} active"}
|
||||
:last-active "Active a minute ago"
|
||||
|
||||
;profile
|
||||
:profile "Profile"
|
||||
:report-user "REPORT USER"
|
||||
:message "Message"
|
||||
:username "Username"
|
||||
:phone-number "Phone number"
|
||||
:email "Email"
|
||||
|
||||
;sign-up
|
||||
:contacts-syncronized "Your contacts have been synchronized"
|
||||
:confirmation-code (str "Thanks! We've sent you a text message with a confirmation "
|
||||
"code. Please provide that code to confirm your phone number")
|
||||
:password-saved (str "OK great! Your password has been saved. Just to let you "
|
||||
"know you can always change it in the Console by the way "
|
||||
"it's me the Console nice to meet you!")
|
||||
:generate-passphrase (str "I'll generate a passphrase for you so you can restore your "
|
||||
"access or log in from another device")
|
||||
:passphrase "Here's your passphrase:"
|
||||
:written-down "Make sure you had securely written it down"
|
||||
:phone-number-required (str "Your phone number is also required to use the app. Type the "
|
||||
"exclamation mark or hit the icon to open the command list "
|
||||
"and choose the !phone command")
|
||||
:intro-status (str "The brash businessman’s braggadocio "
|
||||
"and public exchange with candidates "
|
||||
"in the US presidential election")
|
||||
:intro-message1 "Hello there! It's Status a Dapp browser in your phone."
|
||||
:intro-message2 (str "Status1 uses a highly secure key-pair authentication type "
|
||||
"to provide you a reliable way to access your account")
|
||||
:keypair-generated (str "A key pair has been generated and saved to your device. "
|
||||
"Create a password to secure your key")
|
||||
|
||||
;chats
|
||||
:chats "Chats"
|
||||
:new-chat "New Chat"
|
||||
:new-group-chat "New Group Chat"
|
||||
|
||||
;discover
|
||||
:discovery "Discovery"
|
||||
:none "None"
|
||||
:search-tags "Type your search tags here"
|
||||
:popular-tags "Popular tags"
|
||||
:recent "Recent"
|
||||
|
||||
;settings
|
||||
:settings "Settings"
|
||||
|
||||
;contacts
|
||||
:contacts "Contacts"
|
||||
:no-name "Noname"
|
||||
|
||||
;group-settings
|
||||
:remove "Remove"
|
||||
:save "Save"
|
||||
:change-color "Change color"
|
||||
:clear-history "Clear history"
|
||||
:delete-and-leave "Delete and leave"
|
||||
:chat-settings "Chat settings"
|
||||
:edit "Edit"
|
||||
:add-members "Add Members"
|
||||
:blue "Blue"
|
||||
:purple "Purple"
|
||||
:green "Green"
|
||||
:red "Red"
|
||||
|
||||
;commands
|
||||
:money-command-description "Send money"
|
||||
:location-command-description "Send location"
|
||||
:phone-command-description "Send phone number"
|
||||
:phone-request-text "Phone number request"
|
||||
:confirmation-code-coomand-description "Send confirmation code"
|
||||
:confirmation-code-request-text "Confirmation code request"
|
||||
:send-command-description "Send location"
|
||||
: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"
|
||||
|
||||
})
|
Loading…
Reference in New Issue