diff --git a/src/i18n/i18n.cljs b/src/i18n/i18n.cljs index af608c6e9a..2b3b1a6668 100644 --- a/src/i18n/i18n.cljs +++ b/src/i18n/i18n.cljs @@ -1,14 +1,78 @@ (ns i18n.i18n (:require ["i18n-js" :as i18n] [clojure.string :as string] - [status-im.goog.i18n :as goog.i18n])) + [status-im.goog.i18n :as goog.i18n] + [react-native.languages :as react-native-languages])) + +(def default-device-language (react-native-languages/get-lang-keyword)) + +(def languages + #{:ar :bn :de :el :en :es :es_419 :es_AR :fil :fr :hi :id :in :it :ja :ko :ms :nl :pl :pt :pt_BR :ru + :tr :vi :zh :zh_Hant :zh_TW}) + +(defn valid-language + [lang] + (if (contains? languages lang) + (keyword lang) + (let [parts (string/split (name lang) #"[\-\_]") + short-lang (keyword (str (first parts) "_" (second parts))) + shortest-lang (keyword (first parts))] + (if (and (> (count parts) 2) (contains? languages short-lang)) + short-lang + (when (contains? languages shortest-lang) + shortest-lang))))) + +(defn require-translation + [lang-key] + (when-let [lang (valid-language (keyword lang-key))] + (case lang + :ar (js/require "../translations/ar.json") + :bn (js/require "../translations/bn.json") + :de (js/require "../translations/de.json") + :el (js/require "../translations/el.json") + :en (js/require "../translations/en.json") + :es (js/require "../translations/es.json") + :es_419 (js/require "../translations/es_419.json") + :es_AR (js/require "../translations/es_AR.json") + :fil (js/require "../translations/fil.json") + :fr (js/require "../translations/fr.json") + :hi (js/require "../translations/hi.json") + :id (js/require "../translations/id.json") + :in (js/require "../translations/id.json") + :it (js/require "../translations/it.json") + :ja (js/require "../translations/ja.json") + :ko (js/require "../translations/ko.json") + :ms (js/require "../translations/ms.json") + :nl (js/require "../translations/nl.json") + :pl (js/require "../translations/pl.json") + :pt (js/require "../translations/pt.json") + :pt_BR (js/require "../translations/pt_BR.json") + :ru (js/require "../translations/ru.json") + :tr (js/require "../translations/tr.json") + :vi (js/require "../translations/vi.json") + :zh (js/require "../translations/zh.json") + :zh_Hant (js/require "../translations/zh_hant.json") + :zh_TW (js/require "../translations/zh_TW.json")))) + +(def translations-by-locale + (cond-> {:en (require-translation :en)} + (not= :en default-device-language) + (assoc default-device-language + (require-translation (-> (name default-device-language) + (string/replace "-" "_") + keyword))))) + +(set! (.-fallbacks i18n) true) +(set! (.-defaultSeparator i18n) "/") +(set! (.-locale i18n) (name default-device-language)) +(set! (.-translations i18n) (clj->js translations-by-locale)) (defn init - [default-device-language translations-by-locale] + [] (set! (.-fallbacks i18n) true) (set! (.-defaultSeparator i18n) "/") - (set! (.-locale i18n) default-device-language) - (set! (.-translations i18n) translations-by-locale)) + (set! (.-locale i18n) (name default-device-language)) + (set! (.-translations i18n) (clj->js translations-by-locale))) (defn get-translations [] @@ -70,3 +134,12 @@ (.-locale i18n)) (def format-currency goog.i18n/format-currency) + +(defn load-language + [lang loaded-languages] + (when-let [lang-key (valid-language (keyword lang))] + (when-not (contains? @loaded-languages lang-key) + (aset (i18n/get-translations) + lang + (require-translation lang-key)) + (swap! loaded-languages conj lang-key)))) diff --git a/src/quo2/components/community/token_gating.cljs b/src/quo2/components/community/token_gating.cljs index e2de3dc51b..e56e0a466e 100644 --- a/src/quo2/components/community/token_gating.cljs +++ b/src/quo2/components/community/token_gating.cljs @@ -7,7 +7,7 @@ [quo2.components.markdown.text :as text] [quo2.components.tags.token-tag :as token-tag] [quo2.foundations.colors :as colors] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.fast-image :as fast-image])) (def ^:private token-tag-horizontal-spacing 7) diff --git a/src/quo2/components/notifications/activity_log/view.cljs b/src/quo2/components/notifications/activity_log/view.cljs index 7a774ab8d2..f7e9cdc674 100644 --- a/src/quo2/components/notifications/activity_log/view.cljs +++ b/src/quo2/components/notifications/activity_log/view.cljs @@ -9,7 +9,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n])) + [i18n.i18n :as i18n])) (def ^:private max-reply-length 280) diff --git a/src/status_im/add_new/core.cljs b/src/status_im/add_new/core.cljs index 63e239b0ed..12f8c736a8 100644 --- a/src/status_im/add_new/core.cljs +++ b/src/status_im/add_new/core.cljs @@ -7,7 +7,7 @@ [status-im.ethereum.core :as ethereum] [status-im.ethereum.ens :as ens] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.router.core :as router] [status-im.utils.db :as utils.db] [utils.re-frame :as rf] diff --git a/src/status_im/bootnodes/core.cljs b/src/status_im/bootnodes/core.cljs index 0d53241dd3..b8c1798e8e 100644 --- a/src/status_im/bootnodes/core.cljs +++ b/src/status_im/bootnodes/core.cljs @@ -1,7 +1,7 @@ (ns status-im.bootnodes.core (:require [clojure.string :as string] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [utils.re-frame :as rf] [status-im2.navigation.events :as navigation])) diff --git a/src/status_im/browser/core.cljs b/src/status_im/browser/core.cljs index c7c36c6a23..5bc80ac816 100644 --- a/src/status_im/browser/core.cljs +++ b/src/status_im/browser/core.cljs @@ -11,7 +11,7 @@ [status-im.constants :as constants] [status-im.ethereum.core :as ethereum] [status-im.ethereum.ens :as ens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.native-module.core :as status] [status-im.signing.core :as signing] diff --git a/src/status_im/browser/permissions.cljs b/src/status_im/browser/permissions.cljs index f2da467cd6..98532aa810 100644 --- a/src/status_im/browser/permissions.cljs +++ b/src/status_im/browser/permissions.cljs @@ -1,6 +1,6 @@ (ns status-im.browser.permissions (:require [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scanner] [utils.re-frame :as rf] [status-im2.navigation.events :as navigation])) diff --git a/src/status_im/chat/models.cljs b/src/status_im/chat/models.cljs index 6dc4e95652..1e6f024bf9 100644 --- a/src/status_im/chat/models.cljs +++ b/src/status_im/chat/models.cljs @@ -8,7 +8,7 @@ [status-im.constants :as constants] [status-im.data-store.chats :as chats-store] [status-im.data-store.contacts :as contacts-store] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.mailserver.core :as mailserver] [status-im.multiaccounts.model :as multiaccounts.model] [status-im.ui.screens.chat.state :as chat.state] diff --git a/src/status_im/chat/models/images.cljs b/src/status_im/chat/models/images.cljs index 45cf437631..aafca3c622 100644 --- a/src/status_im/chat/models/images.cljs +++ b/src/status_im/chat/models/images.cljs @@ -4,7 +4,7 @@ [clojure.string :as string] [re-frame.core :as re-frame] [status-im.chat.models :as chat] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.permissions :as permissions] [status-im.ui.components.react :as react] [status-im.utils.config :as config] diff --git a/src/status_im/chat/models/input.cljs b/src/status_im/chat/models/input.cljs index d72f3e72cc..2fe484004e 100644 --- a/src/status_im/chat/models/input.cljs +++ b/src/status_im/chat/models/input.cljs @@ -9,9 +9,9 @@ [status-im.chat.models.message :as chat.message] [status-im.chat.models.message-content :as message-content] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] - [status-im.utils.datetime :as datetime] [utils.re-frame :as rf] + [i18n.i18n :as i18n] + [utils.datetime :as datetime] [status-im.utils.utils :as utils] [taoensso.timbre :as log])) diff --git a/src/status_im/chat/models/input_test.cljs b/src/status_im/chat/models/input_test.cljs index ae5380de68..344a589501 100644 --- a/src/status_im/chat/models/input_test.cljs +++ b/src/status_im/chat/models/input_test.cljs @@ -2,7 +2,7 @@ (:require [cljs.test :refer-macros [deftest is testing]] [status-im.chat.constants :as constants] [status-im.chat.models.input :as input] - [status-im.utils.datetime :as datetime])) + [utils.datetime :as datetime])) (deftest text->emoji (is (nil? (input/text->emoji nil))) diff --git a/src/status_im/chat/models/message_list.cljs b/src/status_im/chat/models/message_list.cljs index 32c0647ff8..00d50c91e2 100644 --- a/src/status_im/chat/models/message_list.cljs +++ b/src/status_im/chat/models/message_list.cljs @@ -1,17 +1,17 @@ (ns status-im.chat.models.message-list (:require ["functional-red-black-tree" :as rb-tree] [status-im.constants :as constants] - [status-im.utils.datetime :as time] - [utils.re-frame :as rf])) + [utils.re-frame :as rf] + [utils.datetime :as datetime])) (defn- add-datemark [{:keys [whisper-timestamp] :as msg}] ;;TODO this is slow - (assoc msg :datemark (time/day-relative whisper-timestamp))) + (assoc msg :datemark (datetime/day-relative whisper-timestamp))) (defn- add-timestamp [{:keys [whisper-timestamp] :as msg}] - (assoc msg :timestamp-str (time/timestamp->time whisper-timestamp))) + (assoc msg :timestamp-str (datetime/timestamp->time whisper-timestamp))) (defn prepare-message [{:keys [message-id diff --git a/src/status_im/ens/core.cljs b/src/status_im/ens/core.cljs index d2657b1989..4499c06285 100644 --- a/src/status_im/ens/core.cljs +++ b/src/status_im/ens/core.cljs @@ -8,8 +8,8 @@ [status-im.ethereum.ens :as ens] [status-im.ethereum.stateofus :as stateofus] [status-im.multiaccounts.update.core :as multiaccounts.update] - [status-im.utils.datetime :as datetime] [utils.re-frame :as rf] + [utils.datetime :as datetime] [status-im.utils.random :as random] [status-im2.navigation.events :as navigation])) diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 32a5ae9c4b..5607643669 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -21,7 +21,7 @@ status-im.ethereum.subscriptions status-im.fleet.core status-im.http.core - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.core :as keycard] status-im.log-level.core status-im.mailserver.constants diff --git a/src/status_im/fleet/core.cljs b/src/status_im/fleet/core.cljs index 37b3b3c8a4..00c5bc0e19 100644 --- a/src/status_im/fleet/core.cljs +++ b/src/status_im/fleet/core.cljs @@ -1,7 +1,7 @@ (ns status-im.fleet.core (:require [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.node.core :as node] [status-im.utils.config :as config] diff --git a/src/status_im/group_chats/core.cljs b/src/status_im/group_chats/core.cljs index 2c3bc8b908..e679af2e6f 100644 --- a/src/status_im/group_chats/core.cljs +++ b/src/status_im/group_chats/core.cljs @@ -5,8 +5,8 @@ [re-frame.core :as re-frame] [status-im.chat.models :as models.chat] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] [utils.re-frame :as rf] + [i18n.i18n :as i18n] [status-im2.contexts.activity-center.events :as activity-center] [status-im2.navigation.events :as navigation])) diff --git a/src/status_im/i18n/i18n.cljs b/src/status_im/i18n/i18n.cljs deleted file mode 100644 index 96d7457c8a..0000000000 --- a/src/status_im/i18n/i18n.cljs +++ /dev/null @@ -1,73 +0,0 @@ -(ns status-im.i18n.i18n - (:require ["i18n-js" :as i18n] - [clojure.string :as string] - [status-im.goog.i18n :as goog.i18n] - [status-im.i18n.i18n-resources :as i18n-resources])) -;;TODO (14/11/22 flexsurfer) this namespace has been moved to the root level, we keep this only for old -;;(status 1.0) code, -;; can be removed with old code later - -(set! (.-locale i18n) (name i18n-resources/default-device-language)) -(set! (.-fallbacks i18n) true) -(set! (.-defaultSeparator i18n) "/") - -(set! (.-translations i18n) - (clj->js i18n-resources/translations-by-locale)) - -(defn set-language - [lang] - (i18n-resources/load-language lang) - (set! (.-locale i18n) lang)) - -;;:zh, :zh-hans-xx, :zh-hant-xx have been added until this bug will be fixed -;;https://github.com/fnando/i18n-js/issues/460 - -(def delimeters - "This function is a hack: mobile Safari doesn't support toLocaleString(), so we need to pass - this map to WKWebView to make number formatting work." - (let [n (.toLocaleString ^js (js/Number 1000.1)) - delimiter? (= (count n) 7)] - (if delimiter? - {:delimiter (subs n 1 2) - :separator (subs n 5 6)} - {:delimiter "" - :separator (subs n 4 5)}))) - -(defn label-number - [number] - (when number - (let [{:keys [delimiter separator]} delimeters] - (.toNumber i18n - (string/replace number #"," ".") - (clj->js {:precision 10 - :strip_insignificant_zeros true - :delimiter delimiter - :separator separator}))))) - -(def default-option-value "") - -(defn label-options - [options] - ;; i18n ignores nil value, leading to misleading messages - (into {} (for [[k v] options] [k (or v default-option-value)]))) - -(defn label-fn - ([path] (label-fn path {})) - ([path options] - (if (exists? (.t i18n)) - (let [options (update options :amount label-number)] - (.t i18n (name path) (clj->js (label-options options)))) - (name path)))) - -(def label (memoize label-fn)) - -(defn label-pluralize - [count path & options] - (if (exists? (.t i18n)) - (.p i18n count (name path) (clj->js options)) - (name path))) - -(def locale - (.-locale i18n)) - -(def format-currency goog.i18n/format-currency) \ No newline at end of file diff --git a/src/status_im/i18n/i18n_resources.cljs b/src/status_im/i18n/i18n_resources.cljs deleted file mode 100644 index a27e7659c7..0000000000 --- a/src/status_im/i18n/i18n_resources.cljs +++ /dev/null @@ -1,84 +0,0 @@ -(ns status-im.i18n.i18n-resources - (:require ["i18n-js" :as i18n-js] - ["react-native-languages" :default react-native-languages] - [clojure.string :as string])) -;;TODO (14/11/22 flexsurfer) this namespace has been moved to the status-im2 namespace, we keep this -;;only -;;for old (status 1.0) code, -;; can be removed with old code later - -(def get-keyword - (if js/global.__TEST__ str keyword)) - -(def default-device-language - (get-keyword (.-language react-native-languages))) - -(def languages - #{:ar :bn :de :el :en :es :es_419 :es_AR :fil :fr :hi :id :in :it :ja :ko :ms :nl :pl :pt :pt_BR :ru - :tr :vi :zh :zh_Hant :zh_TW}) - -(defonce loaded-languages - (atom - (conj #{:en} default-device-language))) - -(defn valid-language - [lang] - (if (contains? languages lang) - (get-keyword lang) - (let [parts (string/split (name lang) #"[\-\_]") - short-lang (get-keyword (str (first parts) "_" (second parts))) - shortest-lang (get-keyword (first parts))] - (if (and (> (count parts) 2) (contains? languages short-lang)) - short-lang - (when (contains? languages shortest-lang) - shortest-lang))))) - -(defn require-translation - [lang-key] - (when-let [lang (valid-language (get-keyword lang-key))] - (case lang - :ar (js/require "../translations/ar.json") - :bn (js/require "../translations/bn.json") - :de (js/require "../translations/de.json") - :el (js/require "../translations/el.json") - :en (js/require "../translations/en.json") - :es (js/require "../translations/es.json") - :es_419 (js/require "../translations/es_419.json") - :es_AR (js/require "../translations/es_AR.json") - :fil (js/require "../translations/fil.json") - :fr (js/require "../translations/fr.json") - :hi (js/require "../translations/hi.json") - :id (js/require "../translations/id.json") - :in (js/require "../translations/id.json") - :it (js/require "../translations/it.json") - :ja (js/require "../translations/ja.json") - :ko (js/require "../translations/ko.json") - :ms (js/require "../translations/ms.json") - :nl (js/require "../translations/nl.json") - :pl (js/require "../translations/pl.json") - :pt (js/require "../translations/pt.json") - :pt_BR (js/require "../translations/pt_BR.json") - :ru (js/require "../translations/ru.json") - :tr (js/require "../translations/tr.json") - :vi (js/require "../translations/vi.json") - :zh (js/require "../translations/zh.json") - :zh_Hant (js/require "../translations/zh_hant.json") - :zh_TW (js/require "../translations/zh_TW.json")))) - -;; translations -(def translations-by-locale - (cond-> {:en (require-translation :en)} - (not= :en default-device-language) - (assoc default-device-language - (require-translation (-> (name default-device-language) - (string/replace "-" "_") - get-keyword))))) - -(defn load-language - [lang] - (when-let [lang-key (valid-language (get-keyword lang))] - (when-not (contains? @loaded-languages lang-key) - (aset (.-translations i18n-js) - lang - (require-translation lang-key)) - (swap! loaded-languages conj lang-key)))) diff --git a/src/status_im/i18n/i18n_test.cljs b/src/status_im/i18n/i18n_test.cljs deleted file mode 100644 index 5db8f5b350..0000000000 --- a/src/status_im/i18n/i18n_test.cljs +++ /dev/null @@ -1,1118 +0,0 @@ -(ns status-im.i18n.i18n-test - (:require [cljs.spec.alpha :as spec] - [cljs.test :refer-macros [deftest is]] - [clojure.set :as set] - [clojure.string :as string] - [status-im.i18n.i18n :as i18n] - [status-im.i18n.i18n-resources :as i18n-resources])) -;;TODO (14/11/22 flexsurfer) this namespace has been moved to the status-im2 namespace, we keep this -;;only -;;for old (status 1.0) code, -;; can be removed with old code later - -;; english as source of truth -(def labels - (set (keys (js->clj (:en i18n-resources/translations-by-locale) - :keywordize-keys - true)))) - -(spec/def ::label labels) -(spec/def ::labels (spec/coll-of ::label :kind set? :into #{})) - -(defn labels-for-all-locales - [] - (->> i18n-resources/translations-by-locale - (mapcat #(-> % val (js->clj :keywordize-keys true) keys)) - set)) - -;; checkpoints - -;; Checkpoints specify milestones for locales. -;; -;; With milestones we can ensure that expected supported languages -;; are actually supported, and visualize the translation state for -;; the rest of locales according to these milestones. -;; -;; Checkpoints are defined by indicating the labels that need to be present -;; in a locale to achieve that checkpoint. -;; -;; We need to define the checkpoint that needs to be achieved for -;; a locale to be considered supported. This is why as we develop -;; we add translations, so we need to be defining a new target -;; for supported languages to achieve. -;; -;; Checkpoints are only used in dev and test. In dev when we want to -;; manually check the state of checkpoints for locales, and in test -;; to automatically check supported locales against the target checkpoint. - -(spec/def ::checkpoint.id keyword?) -(spec/def ::checkpoint-defs (spec/map-of ::checkpoint.id ::labels)) - -;; We define here the labels for the first specified checkpoint. -(def checkpoint-1-0-0-rc1-labels - #{:You - :about-app - :about-key-storage-content - :about-key-storage-title - :about-names-content - :about-names-title - :access-key - :account-added - :account-color - :account-name - :account-settings - :accounts - :active-online - :active-unknown - :add - :add-a-watch-account - :add-account - :add-account-description - :add-account-incorrect-password - :add-an-account - :add-bootnode - :add-contact - :add-custom-token - :add-mailserver - :add-members - :add-network - :add-to-contacts - :address - :advanced - :advanced-settings - :agree-by-continuing - :all - :allow - :allowing-authorizes-this-dapp - :already-have-asset - :amount - :are-you-sure-description - :are-you-sure? - :ask-in-status - :at - :authorize - :available - :available-participants - :back - :back-up-seed-phrase - :back-up-your-seed-phrase - :backup-recovery-phrase - :balance - :begin-set-up - :biometric-auth-android-sensor-desc - :biometric-auth-android-sensor-error-desc - :biometric-auth-android-title - :biometric-auth-confirm-logout - :biometric-auth-confirm-message - :biometric-auth-confirm-title - :biometric-auth-confirm-try-again - :biometric-auth-error - :biometric-auth-login-error-title - :biometric-auth-login-ios-fallback-label - :biometric-auth-reason-login - :biometric-auth-reason-verify - :blank-keycard-text - :blank-keycard-title - :block - :block-contact - :block-contact-details - :blocked-users - :bootnode-address - :bootnode-details - :bootnode-format - :bootnodes - :bootnodes-enabled - :bootnodes-settings - :browsed-websites - :browser - :browser-not-secure - :browser-secure - :browsers - :browsing-cancel - :browsing-open-in-android-web-browser - :browsing-open-in-ios-web-browser - :browsing-open-in-status - :browsing-site-blocked-description1 - :browsing-site-blocked-description2 - :browsing-site-blocked-go-back - :browsing-site-blocked-title - :browsing-title - :camera-access-error - :can-not-add-yourself - :cancel - :cancel-keycard-setup - :cannot-read-card - :cannot-use-default-pin - :card-is-blank - :card-reseted - :card-unpaired - :change-fleet - :change-log-level - :change-logging-enabled - :change-passcode - :change-password - :change-pin - :changed-amount-warning - :changed-asset-warning - :chaos-mode - :chaos-unicorn-day - :chaos-unicorn-day-details - :chat - :chat-key - :chat-name - :chat-settings - :chats - :check-your-recovery-phrase - :choose-authentication-method - :clear - :clear-history - :clear-history-action - :clear-history-confirmation - :clear-history-confirmation-content - :clear-history-title - :close-app-button - :close-app-content - :close-app-title - :command-button-send - :complete-hardwallet-setup - :completed - :confirm - :confirmations - :confirmations-helper-text - :connect - :connect-mailserver-content - :connected - :connecting - :connecting-requires-login - :connection-with-the-card-lost - :connection-with-the-card-lost-setup-text - :connection-with-the-card-lost-text - :contact-code - :contact-s - :contacts - :continue - :contract-address - :contract-interaction - :copy-info - :copy-qr - :copy-to-clipboard - :copy-transaction-hash - :cost-fee - :counter-9-plus - :create - :create-a-pin - :create-group-chat - :create-multiaccount - :create-new-key - :create-pin - :create-pin-description - :created-group-chat-description - :cryptokitty-name - :currency - :currency-display-name-aed - :currency-display-name-afn - :currency-display-name-ars - :currency-display-name-aud - :currency-display-name-bbd - :currency-display-name-bdt - :currency-display-name-bgn - :currency-display-name-bhd - :currency-display-name-bnd - :currency-display-name-bob - :currency-display-name-brl - :currency-display-name-btn - :currency-display-name-cad - :currency-display-name-chf - :currency-display-name-clp - :currency-display-name-cny - :currency-display-name-cop - :currency-display-name-crc - :currency-display-name-czk - :currency-display-name-dkk - :currency-display-name-dop - :currency-display-name-egp - :currency-display-name-etb - :currency-display-name-eur - :currency-display-name-gbp - :currency-display-name-gel - :currency-display-name-ghs - :currency-display-name-hkd - :currency-display-name-hrk - :currency-display-name-huf - :currency-display-name-idr - :currency-display-name-ils - :currency-display-name-inr - :currency-display-name-isk - :currency-display-name-jmd - :currency-display-name-jpy - :currency-display-name-kes - :currency-display-name-krw - :currency-display-name-kwd - :currency-display-name-kzt - :currency-display-name-lkr - :currency-display-name-mad - :currency-display-name-mdl - :currency-display-name-mur - :currency-display-name-mwk - :currency-display-name-mxn - :currency-display-name-myr - :currency-display-name-mzn - :currency-display-name-nad - :currency-display-name-ngn - :currency-display-name-nok - :currency-display-name-npr - :currency-display-name-nzd - :currency-display-name-omr - :currency-display-name-pen - :currency-display-name-pgk - :currency-display-name-php - :currency-display-name-pkr - :currency-display-name-pln - :currency-display-name-pyg - :currency-display-name-qar - :currency-display-name-ron - :currency-display-name-rsd - :currency-display-name-rub - :currency-display-name-sar - :currency-display-name-sek - :currency-display-name-sgd - :currency-display-name-thb - :currency-display-name-try - :currency-display-name-ttd - :currency-display-name-twd - :currency-display-name-tzs - :currency-display-name-uah - :currency-display-name-ugx - :currency-display-name-usd - :currency-display-name-uyu - :currency-display-name-vef - :currency-display-name-vnd - :currency-display-name-zar - :current-network - :current-pin - :current-pin-description - :custom - :custom-networks - :dapp - :dapp-would-like-to-connect-wallet - :dapps - :dapps-permissions - :data - :datetime-ago - :datetime-ago-format - :datetime-day - :datetime-hour - :datetime-minute - :datetime-second - :datetime-today - :datetime-yesterday - :decimals - :decryption-failed-content - :default - :delete - :delete-and-leave-group - :delete-bootnode - :delete-bootnode-are-you-sure - :delete-bootnode-title - :delete-chat - :delete-chat-confirmation - :delete-confirmation - :delete-mailserver - :delete-mailserver-are-you-sure - :delete-mailserver-title - :delete-message - :delete-my-account - :delete-network-confirmation - :delete-network-error - :delete-network-title - :deny - :description - :dev-mode - :dev-mode-settings - :device-syncing - :devices - :disable - :disabled - :disconnected - :discover - :dismiss - :done - :edit - :edit-profile - :empty-chat-description - :empty-chat-description-one-to-one - :empty-chat-description-public - :empty-chat-description-public-share-this - :enable - :encrypt-with-password - :ens-10-SNT - :ens-add-username - :ens-agree-to - :ens-chat-settings - :ens-custom-domain - :ens-custom-username-hints - :ens-custom-username-taken - :ens-deposit - :ens-displayed-with - :ens-get-name - :ens-got-it - :ens-locked - :ens-network-restriction - :ens-no-usernames - :ens-powered-by - :ens-primary-username - :ens-register - :ens-registration-failed - :ens-registration-failed-title - :ens-release-username - :ens-remove-hints - :ens-remove-username - :ens-saved - :ens-saved-title - :ens-show-username - :ens-terms-header - :ens-terms-point-1 - :ens-terms-point-10 - :ens-terms-point-2 - :ens-terms-point-3 - :ens-terms-point-4 - :ens-terms-point-5 - :ens-terms-point-6 - :ens-terms-point-7 - :ens-terms-point-8 - :ens-terms-point-9 - :ens-terms-registration - :ens-test-message - :ens-transaction-pending - :ens-understand - :ens-username - :ens-username-connected - :ens-username-hints - :ens-username-invalid - :ens-username-owned - :ens-username-available - :ens-username-taken - :ens-usernames - :ens-usernames-details - :wallet-address - :ens-want-custom-domain - :ens-want-domain - :ens-welcome-hints - :ens-welcome-point-customize - :ens-welcome-point-customize-title - :ens-welcome-point-simplify - :ens-welcome-point-simplify-title - :ens-welcome-point-receive - :ens-welcome-point-receive-title - :ens-welcome-point-register - :ens-welcome-point-register-title - :ens-welcome-point-verify - :ens-welcome-point-verify-title - :ens-your-username - :ens-your-usernames - :ens-your-your-name - :enter-12-words - :enter-contact-code - :enter-pair-code - :enter-pair-code-description - :enter-password - :enter-pin - :enter-puk-code - :enter-puk-code-description - :enter-seed-phrase - :enter-url - :enter-word - :enter-your-code - :enter-your-password - :error - :error-unable-to-get-balance - :error-unable-to-get-prices - :error-unable-to-get-token-balance - :errors - :eth - :ethereum-node-started-incorrectly-description - :ethereum-node-started-incorrectly-title - :etherscan-lookup - :export-account - :failed - :faq - :fetch-messages - :find - :finish - :finishing-card-setup - :fleet - :fleet-settings - :from - :gas-limit - :gas-price - :gas-used - :generate-a-key - :generate-a-new-account - :generate-a-new-key - :generate-account - :generate-new-key - :generating-codes-for-pairing - :generating-keys - :generating-mnemonic - :get-started - :get-status-at - :get-stickers - :go-to-settings - :got-it - :group-chat - :group-chat-admin - :group-chat-admin-added - :group-chat-created - :group-chat-decline-invitation - :group-chat-member-added - :group-chat-member-joined - :group-chat-member-removed - :group-chat-members-count - :group-chat-name-changed - :group-chat-no-contacts - :group-info - :gwei - :hash - :help - :help-capitalized - :help-center - :hide-content-when-switching-apps - :history - :history-nodes - :hold-card - :home - :hooks - :identifier - :image-remove-current - :image-source-gallery - :image-source-make-photo - :image-source-title - :in-contacts - :incoming - :incorrect-code - :initialization - :install - :intro-message1 - :intro-privacy-policy-note1 - :intro-privacy-policy-note2 - :intro-text - :intro-text1 - :intro-text2 - :intro-text3 - :intro-title1 - :intro-title2 - :intro-title3 - :intro-wizard-text1 - :intro-wizard-text2 - :intro-wizard-text3 - :intro-wizard-text4 - :intro-wizard-text6 - :intro-wizard-title-alt4 - :intro-wizard-title-alt5 - :intro-wizard-title1 - :intro-wizard-title2 - :intro-wizard-title3 - :intro-wizard-title4 - :intro-wizard-title5 - :intro-wizard-title6 - :invalid-address-qr-code - :invalid-format - :invalid-key-confirm - :invalid-key-content - :invalid-number - :invalid-pairing-password - :invalid-range - :invite-friends - :invited - :join-group-chat - :join-group-chat-description - :joined-group-chat-description - :key - :keycard - :keycard-applet-install-instructions - :keycard-blocked - :keycard-cancel-setup-text - :keycard-cancel-setup-title - :keycard-desc - :keycard-has-multiaccount-on-it - :keycard-onboarding-finishing-header - :keycard-onboarding-intro-header - :keycard-onboarding-intro-text - :keycard-onboarding-pairing-header - :keycard-onboarding-preparing-header - :keycard-onboarding-puk-code-header - :keycard-onboarding-recovery-phrase-description - :keycard-onboarding-recovery-phrase-header - :keycard-onboarding-recovery-phrase-text - :keycard-onboarding-start-header - :keycard-onboarding-start-step1 - :keycard-onboarding-start-step1-text - :keycard-onboarding-start-step2 - :keycard-onboarding-start-step2-text - :keycard-onboarding-start-step3 - :keycard-onboarding-start-step3-text - :keycard-onboarding-start-text - :keycard-recovery-intro-button-text - :keycard-recovery-intro-header - :keycard-recovery-intro-text - :keycard-recovery-no-key-header - :keycard-recovery-no-key-text - :keycard-recovery-phrase-confirm-header - :keycard-recovery-phrase-confirmation-text - :keycard-recovery-phrase-confirmation-title - :keycard-recovery-success-header - :keycard-unauthorized-operation - :language - :learn-more - :learn-more-about-keycard - :leave - :leave-group - :left - :les-ulc - :linked-on - :load-messages-before - :load-more-messages - :loading - :log-level - :log-level-settings - :logging - :logging-enabled - :login-pin-description - :logout - :logout-app-content - :logout-are-you-sure - :logout-title - :mailserver-address - :mailserver-automatic - :mailserver-connection-error - :mailserver-details - :mailserver-error-content - :mailserver-error-title - :mailserver-format - :mailserver-pick-another - :mailserver-reconnect - :mailserver-request-error-content - :mailserver-request-error-status - :mailserver-request-error-title - :mailserver-request-retry - :mailserver-retry - :main-currency - :main-networks - :main-wallet - :mainnet-network - :make-admin - :members - :members-active - :members-active-none - :members-title - :message - :message-not-sent - :message-options-cancel - :message-reply - :data-syncing - :messages - :might-break - :migrations-failed-content - :mobile-network-ask-me - :mobile-network-continue-syncing - :mobile-network-continue-syncing-details - :mobile-network-go-to-settings - :mobile-network-settings - :mobile-network-sheet-configure - :mobile-network-sheet-offline - :mobile-network-sheet-offline-details - :mobile-network-sheet-remember-choice - :mobile-network-sheet-settings - :mobile-network-start-syncing - :mobile-network-stop-syncing - :mobile-network-stop-syncing-details - :mobile-network-use-mobile - :mobile-network-use-mobile-data - :mobile-network-use-wifi - :mobile-syncing-sheet-details - :mobile-syncing-sheet-title - :more - :multiaccounts-recover-enter-phrase-text - :multiaccounts-recover-enter-phrase-title - :name - :name-of-token - :need-help - :network - :network-chain - :network-details - :network-fee - :network-id - :network-invalid-network-id - :network-invalid-status-code - :network-invalid-url - :network-settings - :new - :new-chat - :new-contact - :new-contract - :new-group - :new-group-chat - :new-network - :new-pin-description - :new-public-group-chat - :next - :no - :no-collectibles - :no-contacts - :no-keycard-applet-on-card - :no-messages - :no-pairing-slots-available - :no-result - :no-tokens-found - :node-info - :node-version - :nonce - :none - :not-applicable - :not-keycard-text - :not-keycard-title - :notifications - :notify - :off - :offline - :ok - :ok-continue - :ok-got-it - :okay - :on - :open - :open-dapp - :open-dapp-store - :open-nfc-settings - :open-on-block-explorer - :optional - :outgoing - :pair - :pair-card - :pair-code - :pair-code-explanation - :pair-this-card - :pair-this-device - :pair-this-device-description - :paired-devices - :pairing - :pairing-card - :pairing-go-to-installation - :pairing-maximum-number-reached-content - :pairing-maximum-number-reached-title - :pairing-new-installation-detected-content - :pairing-new-installation-detected-title - :pairing-no-info - :pairing-please-set-a-name - :passphrase - :password - :password-description - :password-placeholder2 - :password_error1 - :paste - :paste-json - :pay-to-chat - :peers - :pending - :pending-confirmation - :permissions - :phone-e164 - :photos-access-error - :pin-changed - :pin-code - :pin-mismatch - :preview-privacy - :privacy - :privacy-and-security - :privacy-policy - :processing - :product-information - :profile - :public-chat - :public-chats - :public-group-status - :public-group-topic - :public-key - :puk-and-pairing-codes-displayed - :puk-code - :puk-code-explanation - :puk-mismatch - :quiet-days - :quiet-hours - :re-encrypt-key - :receive - :receive-transaction - :recent - :recent-recipients - :recently-used-stickers - :recipient - :recipient-code - :recover - :recover-key - :recover-keycard-multiaccount-not-supported - :recover-with-keycard - :recovering-key - :recovery-confirm-phrase - :recovery-phrase - :recovery-success-text - :recovery-typo-dialog-description - :recovery-typo-dialog-title - :remember-me - :remind-me-later - :remove - :remove-from-chat - :remove-network - :remove-token - :removed - :repeat-pin - :report-bug-email-template - :request-transaction - :required-field - :resend-message - :reset-card - :reset-card-description - :retry - :revoke-access - :rpc-url - :save - :save-password - :save-password-unavailable - :save-password-unavailable-android - :scan-qr - :scan-qr-code - :search - :secret-keys-confirmation-text - :secret-keys-confirmation-title - :security - :see-details - :see-it-again - :select-chat - :selected - :send-logs - :send-logs-to - :send-message - :send-request - :send-request-amount - :send-request-amount-max-decimals - :send-request-unknown-token - :send-sending-to - :send-transaction - :sending - :sent-at - :set-a-topic - :set-currency - :set-dapp-access-permissions - :settings - :share - :share-address - :share-chat - :share-contact-code - :share-dapp-text - :share-link - :share-my-profile - :share-profile - :share-profile-link - :share-public-chat-text - :sharing-copied-to-clipboard - :sharing-copy-to-clipboard - :sharing-share - :show-less - :show-more - :show-qr - :sign-in - :sign-message - :sign-out - :sign-with - :sign-with-password - :sign-you-in - :signing - :signing-a-message - :signing-phrase - :something-went-wrong - :soon - :specify-address - :specify-name - :specify-network-id - :specify-rpc-url - :start-chat - :start-conversation - :start-group-chat - :start-new-chat - :status - :status-confirmed - :status-keycard - :status-hardwallet - :status-not-sent-click - :status-not-sent-tap - :status-pending - :status-sent - :status-tx-not-found - :step-i-of-n - :sticker-market - :submit - :submit-bug - :success - :symbol - :sync-all-devices - :sync-in-progress - :sync-settings - :sync-synced - :syncing-devices - :tag-was-lost - :test-networks - :text-input-disabled - :this-device - :this-device-desc - :this-is-you-signing - :this-will-take-few-seconds - :three-words-description - :three-words-description-2 - :to - :to-block - :to-encrypt-enter-password - :to-see-this-message - :token-auto-validate-decimals-error - :token-auto-validate-name-error - :token-auto-validate-symbol-error - :token-details - :topic-name-error - :transaction - :transaction-description - :transaction-details - :transaction-failed - :transaction-history - :transaction-request - :transaction-sent - :transactions - :transactions-filter-select-all - :transactions-filter-title - :type - :transactions-history - :transactions-history-empty - :transactions-sign - :tribute-required-by-multiaccount - :tribute-state-paid - :tribute-state-pending - :tribute-state-required - :tribute-to-talk - :tribute-to-talk-add-friends - :tribute-to-talk-are-you-friends - :tribute-to-talk-ask-to-be-added - :tribute-to-talk-contact-received-your-tribute - :tribute-to-talk-desc - :tribute-to-talk-disabled - :tribute-to-talk-disabled-note - :tribute-to-talk-enabled - :tribute-to-talk-finish-desc - :tribute-to-talk-learn-more-1 - :tribute-to-talk-learn-more-2 - :tribute-to-talk-learn-more-3 - :tribute-to-talk-paywall-learn-more-1 - :tribute-to-talk-paywall-learn-more-2 - :tribute-to-talk-paywall-learn-more-3 - :tribute-to-talk-pending - :tribute-to-talk-pending-note - :tribute-to-talk-removing-note - :tribute-to-talk-set-snt-amount - :tribute-to-talk-signing - :tribute-to-talk-transaction-failed-note - :tribute-to-talk-tribute-received1 - :tribute-to-talk-tribute-received2 - :tribute-to-talk-you-require-snt - :try-again - :turn-nfc-on - :type-a-message - :ulc-enabled - :unable-to-read-this-code - :unblock-contact - :unknown-status-go-error - :unlock - :unpair-card - :unpair-card-confirmation - :unpaired-keycard-text - :unpaired-keycard-title - :update - :url - :usd-currency - :use-valid-contact-code - :validation-amount-invalid-number - :validation-amount-is-too-precise - :version - :view-cryptokitties - :view-cryptostrikers - :view-etheremon - :view-gitcoin - :view-profile - :view-signing - :view-superrare - :waiting-for-wifi - :waiting-for-wifi-change - :waiting-to-sign - :wallet - :wallet-asset - :wallet-assets - :wallet-backup-recovery-title - :wallet-choose-recipient - :wallet-collectibles - :wallet-insufficient-funds - :wallet-insufficient-gas - :wallet-invalid-address - :wallet-invalid-address-checksum - :wallet-invalid-chain-id - :wallet-manage-assets - :wallet-request - :wallet-send - :wallet-send-min-wei - :wallet-settings - :wallet-total-value - :wallet-transaction-total-fee - :wants-to-access-profile - :warning - :warning-message - :web-view-error - :welcome-screen-text - :welcome-to-status - :welcome-to-status-description - :word-n - :word-n-description - :words-n - :write-down-and-store-securely - :wrong-address - :wrong-card - :wrong-card-text - :wrong-contract - :wrong-keycard-text - :wrong-keycard-title - :wrong-password - :wrong-word - :yes - :you - :you-already-have-an-asset - :you-are-all-set - :you-are-all-set-description - :you-can-change-account - :you-dont-have-stickers - :your-contact-code - :your-data-belongs-to-you - :your-data-belongs-to-you-description - :your-recovery-phrase - :your-recovery-phrase-description}) - -;; NOTE: the rest checkpoints are based on the previous one, defined -;; like this: -;; (def checkpoint-2-labels (set/union checkpoint-1-labels #{:foo :bar}) -;; (def checkpoint-3-labels (set/union checkpoint-2-labels #{:baz}) - -;; NOTE: This defines the scope of each checkpoint. To support a checkpoint, -;; change the var `checkpoint-to-consider-locale-supported` a few lines -;; below. -(def checkpoints-def - (spec/assert ::checkpoint-defs - {::checkpoint-1-0-0-rc1 checkpoint-1-0-0-rc1-labels})) -(def checkpoints (set (keys checkpoints-def))) - -(spec/def ::checkpoint checkpoints) - -(def checkpoint-to-consider-locale-supported ::checkpoint-1-0-0-rc1) - -(defn checkpoint->labels - [checkpoint] - (get checkpoints-def checkpoint)) - -(defn checkpoint-val-to-compare - [c] - (-> c name (string/replace #"^.*\|" "") js/parseInt)) - -(defn >checkpoints - [& cs] - (apply > (map checkpoint-val-to-compare cs))) - -;; locales - -(def locales (set (keys i18n-resources/translations-by-locale))) - -(spec/def ::locale locales) -(spec/def ::locales (spec/coll-of ::locale :kind set? :into #{})) - -(defn locale->labels - [locale] - (-> i18n-resources/translations-by-locale (get locale) (js->clj :keywordize-keys true) keys set)) - -(defn locale->checkpoint - [locale] - (let [locale-labels (locale->labels locale) - checkpoint (->> checkpoints-def - (filter (fn [[_ checkpoint-labels]] - (set/subset? checkpoint-labels locale-labels))) - ffirst)] - checkpoint)) - -(defn locale-is-supported-based-on-translations? - [locale] - (let [c (locale->checkpoint locale)] - (and c - (or (= c checkpoint-to-consider-locale-supported) - (>checkpoints checkpoint-to-consider-locale-supported c))))) - -(defn actual-supported-locales - [] - (->> locales - (filter locale-is-supported-based-on-translations?) - set)) - -;; NOTE: Add new locale keywords here to indicate support for them. -#_(def supported-locales - (spec/assert ::locales - #{:fr - :zh - :zh-hans - :zh-hans-cn - :zh-hans-mo - :zh-hant - :zh-hant-sg - :zh-hant-hk - :zh-hant-tw - :zh-hant-mo - :zh-hant-cn - :sr-RS_#Cyrl - :el - :en - :de - :lt - :sr-RS_#Latn - :sr - :sv - :ja - :uk})) -(def supported-locales (spec/assert ::locales #{:en})) - -(spec/def ::supported-locale supported-locales) -(spec/def ::supported-locales (spec/coll-of ::supported-locale :kind set? :into #{})) - -(deftest label-options - (is (not (nil? (:key (i18n/label-options {:key nil})))))) - -(deftest locales-only-have-existing-tran-ids - (is (spec/valid? ::labels (labels-for-all-locales)) - (->> locales - (remove #(spec/valid? ::labels (locale->labels %))) - (map (fn [l] - (str "Extra translations in locale " - l - "\n" - (set/difference (locale->labels l) labels) - "\n\n"))) - (apply str)))) - -(deftest supported-locales-are-actually-supported - (is (set/subset? supported-locales (actual-supported-locales)) - (->> supported-locales - (remove locale-is-supported-based-on-translations?) - (map (fn [l] - (str "Missing translations in supported locale " - l - "\n" - (set/difference (checkpoint->labels checkpoint-to-consider-locale-supported) - (locale->labels l)) - "\n\n"))) - (apply str)))) diff --git a/src/status_im/keycard/backup_key.cljs b/src/status_im/keycard/backup_key.cljs index 9f6fd3faa0..b2abbf2a8a 100644 --- a/src/status_im/keycard/backup_key.cljs +++ b/src/status_im/keycard/backup_key.cljs @@ -1,7 +1,7 @@ (ns status-im.keycard.backup-key (:require [re-frame.core :as re-frame] [status-im.ethereum.mnemonic :as mnemonic] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.common :as common] [status-im.multiaccounts.recover.core :as multiaccounts.recover] [status-im.signing.core :as signing.core] diff --git a/src/status_im/keycard/change_pin.cljs b/src/status_im/keycard/change_pin.cljs index 215019d125..63f12598a2 100644 --- a/src/status_im/keycard/change_pin.cljs +++ b/src/status_im/keycard/change_pin.cljs @@ -1,5 +1,5 @@ (ns status-im.keycard.change-pin - (:require [status-im.i18n.i18n :as i18n] + (:require [i18n.i18n :as i18n] [status-im.keycard.common :as common] [status-im.keycard.onboarding :as onboarding] [utils.re-frame :as rf] diff --git a/src/status_im/keycard/common.cljs b/src/status_im/keycard/common.cljs index d525eeedda..f2b3917c69 100644 --- a/src/status_im/keycard/common.cljs +++ b/src/status_im/keycard/common.cljs @@ -3,12 +3,12 @@ [re-frame.core :as re-frame] [status-im.bottom-sheet.core :as bottom-sheet] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.nfc :as nfc] [status-im.popover.core :as popover] [status-im.ui.screens.keycard.keycard-interaction :as keycard-sheet] - [status-im.utils.datetime :as utils.datetime] [utils.re-frame :as rf] + [utils.datetime :as datetime] [status-im.utils.keychain.core :as keychain] [status-im.utils.platform :as platform] [status-im.utils.types :as types] @@ -429,7 +429,7 @@ (rf/defn update-pairings [{:keys [db]} instance-uid pairing] - (let [paired-on (utils.datetime/timestamp) + (let [paired-on (datetime/timestamp) pairings (-> (get-in db [:keycard :pairings]) (assoc instance-uid {:pairing pairing :paired-on paired-on}))] {:keycard/persist-pairings pairings diff --git a/src/status_im/keycard/core.cljs b/src/status_im/keycard/core.cljs index 8430145f6a..512ac97490 100644 --- a/src/status_im/keycard/core.cljs +++ b/src/status_im/keycard/core.cljs @@ -1,6 +1,6 @@ (ns status-im.keycard.core (:require [re-frame.db] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] status-im.keycard.backup-key [status-im.keycard.card :as card] [status-im.keycard.change-pin :as change-pin] @@ -16,8 +16,8 @@ [status-im.keycard.wallet :as wallet] [status-im.multiaccounts.recover.core :as multiaccounts.recover] [status-im.multiaccounts.update.core :as multiaccounts.update] - [status-im.utils.datetime :as utils.datetime] [utils.re-frame :as rf] + [utils.datetime :as datetime] [status-im2.navigation.events :as navigation] [taoensso.timbre :as log])) @@ -485,7 +485,7 @@ flow (get-in db [:keycard :flow]) instance-uid (get-in db [:keycard :application-info :instance-uid]) multiaccount (common/find-multiaccount-by-keycard-instance-uid db instance-uid) - paired-on (utils.datetime/timestamp) + paired-on (datetime/timestamp) pairings (-> (get-in db [:keycard :pairings]) (dissoc (keyword instance-uid)) (assoc instance-uid {:pairing pairing :paired-on paired-on})) diff --git a/src/status_im/keycard/onboarding.cljs b/src/status_im/keycard/onboarding.cljs index 44937d0d6b..b7051df316 100644 --- a/src/status_im/keycard/onboarding.cljs +++ b/src/status_im/keycard/onboarding.cljs @@ -2,7 +2,7 @@ (:require [clojure.string :as string] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.common :as common] status-im.keycard.fx [status-im.keycard.mnemonic :as mnemonic] diff --git a/src/status_im/keycard/recovery.cljs b/src/status_im/keycard/recovery.cljs index 61d66aad61..1f2d15e245 100644 --- a/src/status_im/keycard/recovery.cljs +++ b/src/status_im/keycard/recovery.cljs @@ -5,15 +5,15 @@ [status-im.constants :as constants] [status-im.ethereum.core :as ethereum] [status-im.ethereum.eip55 :as eip55] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.common :as common] status-im.keycard.fx [status-im.multiaccounts.create.core :as multiaccounts.create] [status-im.multiaccounts.model :as multiaccounts.model] [status-im.native-module.core :as status] [status-im.popover.core :as popover] - [status-im.utils.datetime :as utils.datetime] [utils.re-frame :as rf] + [utils.datetime :as datetime] [status-im.utils.keychain.core :as keychain] [status-im.utils.platform :as platform] [status-im.utils.types :as types] @@ -40,7 +40,7 @@ :keycard.onboarding.pair.ui/next-pressed]} [{:keys [db] :as cofx}] (let [pairing (get-in db [:keycard :secrets :pairing]) - paired-on (get-in db [:keycard :secrets :paired-on] (utils.datetime/timestamp))] + paired-on (get-in db [:keycard :secrets :paired-on] (datetime/timestamp))] (rf/merge cofx (if pairing {:db (-> db @@ -369,7 +369,7 @@ (assoc-in [:keycard :pin :status] :verifying) (assoc-in [:keycard :secrets] {:pairing pairing' - :paired-on (utils.datetime/timestamp)})) + :paired-on (datetime/timestamp)})) :keycard/import-keys {:pin pin :on-success :keycard.callback/on-generate-and-load-key-success}}))) diff --git a/src/status_im/keycard/simulated_keycard.cljs b/src/status_im/keycard/simulated_keycard.cljs index f89cf2554d..b8acb54145 100644 --- a/src/status_im/keycard/simulated_keycard.cljs +++ b/src/status_im/keycard/simulated_keycard.cljs @@ -4,7 +4,7 @@ [re-frame.db :as re-frame.db] [status-im.constants :as constants] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.keycard :as keycard] [status-im.multiaccounts.create.core :as multiaccounts.create] [status-im.native-module.core :as status] diff --git a/src/status_im/keycard/unpair.cljs b/src/status_im/keycard/unpair.cljs index b9fc62a48c..21f9e8029c 100644 --- a/src/status_im/keycard/unpair.cljs +++ b/src/status_im/keycard/unpair.cljs @@ -1,6 +1,6 @@ (ns status-im.keycard.unpair (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.common :as common] [status-im.multiaccounts.key-storage.core :as key-storage] [status-im.multiaccounts.update.core :as multiaccounts.update] diff --git a/src/status_im/log_level/core.cljs b/src/status_im/log_level/core.cljs index b1d2ab28eb..ffe2798403 100644 --- a/src/status_im/log_level/core.cljs +++ b/src/status_im/log_level/core.cljs @@ -1,6 +1,6 @@ (ns status-im.log-level.core (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.node.core :as node] [utils.re-frame :as rf])) diff --git a/src/status_im/mailserver/core.cljs b/src/status_im/mailserver/core.cljs index 68fcb38c51..f7d192b9dc 100644 --- a/src/status_im/mailserver/core.cljs +++ b/src/status_im/mailserver/core.cljs @@ -1,7 +1,7 @@ (ns ^{:doc "Mailserver events and API"} status-im.mailserver.core (:require [clojure.string :as string] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.node.core :as node] [utils.re-frame :as rf] diff --git a/src/status_im/multiaccounts/biometric/core.cljs b/src/status_im/multiaccounts/biometric/core.cljs index eff71c5873..6d7cd7687a 100644 --- a/src/status_im/multiaccounts/biometric/core.cljs +++ b/src/status_im/multiaccounts/biometric/core.cljs @@ -2,7 +2,7 @@ (:require ["react-native-touch-id" :default touchid] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.native-module.core :as status] [status-im.popover.core :as popover] [utils.re-frame :as rf] diff --git a/src/status_im/multiaccounts/create/core.cljs b/src/status_im/multiaccounts/create/core.cljs index b11746154e..effc1b3c24 100644 --- a/src/status_im/multiaccounts/create/core.cljs +++ b/src/status_im/multiaccounts/create/core.cljs @@ -5,7 +5,7 @@ [status-im.data-store.settings :as data-store.settings] [status-im.ethereum.core :as ethereum] [status-im.ethereum.eip55 :as eip55] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.native-module.core :as status] [status-im.node.core :as node] [status-im.utils.config :as config] diff --git a/src/status_im/multiaccounts/key_storage/core.cljs b/src/status_im/multiaccounts/key_storage/core.cljs index c61bbc8731..4aa24abb4b 100644 --- a/src/status_im/multiaccounts/key_storage/core.cljs +++ b/src/status_im/multiaccounts/key_storage/core.cljs @@ -4,7 +4,7 @@ [status-im.bottom-sheet.core :as bottom-sheet] [status-im.ethereum.core :as ethereum] [status-im.ethereum.mnemonic :as mnemonic] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.backup-key :as keycard.backup] [status-im.keycard.common :as common] [status-im.multiaccounts.core :as multiaccounts] diff --git a/src/status_im/multiaccounts/login/core.cljs b/src/status_im/multiaccounts/login/core.cljs index 091b6e23eb..5e53d33bfe 100644 --- a/src/status_im/multiaccounts/login/core.cljs +++ b/src/status_im/multiaccounts/login/core.cljs @@ -15,7 +15,7 @@ [status-im.ethereum.tokens :as tokens] [status-im.ethereum.transactions.core :as transactions] [status-im.fleet.core :as fleet] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.common :as keycard.common] [status-im.mobile-sync-settings.core :as mobile-network] [status-im.multiaccounts.biometric.core :as biometric] diff --git a/src/status_im/multiaccounts/logout/core.cljs b/src/status_im/multiaccounts/logout/core.cljs index 4a33ca9140..4628a0f4bc 100644 --- a/src/status_im/multiaccounts/logout/core.cljs +++ b/src/status_im/multiaccounts/logout/core.cljs @@ -1,6 +1,6 @@ (ns status-im.multiaccounts.logout.core (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.native-module.core :as status] [status-im.notifications.core :as notifications] diff --git a/src/status_im/multiaccounts/recover/core.cljs b/src/status_im/multiaccounts/recover/core.cljs index 3d77cefa4c..2905df0a7c 100644 --- a/src/status_im/multiaccounts/recover/core.cljs +++ b/src/status_im/multiaccounts/recover/core.cljs @@ -5,7 +5,7 @@ [status-im.constants :as constants] [status-im.ethereum.core :as ethereum] [status-im.ethereum.mnemonic :as mnemonic] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.nfc :as nfc] [status-im.multiaccounts.core :as multiaccounts] [status-im.multiaccounts.create.core :as multiaccounts.create] diff --git a/src/status_im/network/core.cljs b/src/status_im/network/core.cljs index cf320e6c47..324fd79075 100644 --- a/src/status_im/network/core.cljs +++ b/src/status_im/network/core.cljs @@ -2,7 +2,7 @@ (:require [clojure.string :as string] [re-frame.core :as re-frame] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.node.core :as node] [utils.re-frame :as rf] [status-im.utils.http :as http] diff --git a/src/status_im/notifications/local.cljs b/src/status_im/notifications/local.cljs index e2b115f8f4..e09dd61c2b 100644 --- a/src/status_im/notifications/local.cljs +++ b/src/status_im/notifications/local.cljs @@ -8,7 +8,7 @@ [status-im.chat.models :as chat.models] [status-im.ethereum.decode :as decode] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.notifications.android :as pn-android] [utils.re-frame :as rf] [status-im.utils.money :as money] diff --git a/src/status_im/pairing/core.cljs b/src/status_im/pairing/core.cljs index 009afbdadd..f9ed64c29d 100644 --- a/src/status_im/pairing/core.cljs +++ b/src/status_im/pairing/core.cljs @@ -1,6 +1,6 @@ (ns status-im.pairing.core (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.utils.config :as config] [utils.re-frame :as rf] diff --git a/src/status_im/qr_scanner/core.cljs b/src/status_im/qr_scanner/core.cljs index bfa9180a1f..d45603ea06 100644 --- a/src/status_im/qr_scanner/core.cljs +++ b/src/status_im/qr_scanner/core.cljs @@ -5,7 +5,7 @@ [status-im.chat.models :as chat] [status-im.ethereum.core :as ethereum] [status-im.group-chats.core :as group-chats] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.router.core :as router] [utils.re-frame :as rf] [status-im.utils.utils :as utils] diff --git a/src/status_im/signals/core.cljs b/src/status_im/signals/core.cljs index a6ee76e54d..6fb1843c00 100644 --- a/src/status_im/signals/core.cljs +++ b/src/status_im/signals/core.cljs @@ -2,7 +2,7 @@ (:require [status-im.chat.models.link-preview :as link.preview] [status-im.chat.models.message :as models.message] [status-im.ethereum.subscriptions :as ethereum.subscriptions] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.mailserver.core :as mailserver] [status-im.multiaccounts.login.core :as login] [status-im.notifications.local :as local-notifications] diff --git a/src/status_im/signing/core.cljs b/src/status_im/signing/core.cljs index 48d76514b9..a9e794eaef 100644 --- a/src/status_im/signing/core.cljs +++ b/src/status_im/signing/core.cljs @@ -6,7 +6,7 @@ [status-im.ethereum.core :as ethereum] [status-im.ethereum.eip55 :as eip55] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.card :as keycard.card] [status-im.keycard.common :as keycard.common] [status-im.native-module.core :as status] diff --git a/src/status_im/signing/gas.cljs b/src/status_im/signing/gas.cljs index e7e8ddf115..a06bd0375c 100644 --- a/src/status_im/signing/gas.cljs +++ b/src/status_im/signing/gas.cljs @@ -3,7 +3,7 @@ [re-frame.core :as re-frame] [status-im.bottom-sheet.core :as bottom-sheet] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.popover.core :as popover] [status-im.signing.eip1559 :as eip1559] [utils.re-frame :as rf] diff --git a/src/status_im/signing/keycard.cljs b/src/status_im/signing/keycard.cljs index 8394607aa3..9b4efa614b 100644 --- a/src/status_im/signing/keycard.cljs +++ b/src/status_im/signing/keycard.cljs @@ -1,6 +1,6 @@ (ns status-im.signing.keycard (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.native-module.core :as status] [utils.re-frame :as rf] [status-im.utils.types :as types] diff --git a/src/status_im/test_runner.cljs b/src/status_im/test_runner.cljs index bdfce7377a..d38df34e48 100644 --- a/src/status_im/test_runner.cljs +++ b/src/status_im/test_runner.cljs @@ -4,7 +4,10 @@ [clojure.string :as string] [shadow.test :as st] [shadow.test.env :as env] - [utils.re-frame :as rf])) + [utils.re-frame :as rf] + [i18n.i18n :as i18n])) + +(i18n/init) (defonce repl? (atom false)) diff --git a/src/status_im/ui/components/action_sheet.cljs b/src/status_im/ui/components/action_sheet.cljs index 63d3ff9ce0..623d2b405c 100644 --- a/src/status_im/ui/components/action_sheet.cljs +++ b/src/status_im/ui/components/action_sheet.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.components.action-sheet (:require ["react-native" :refer (ActionSheetIOS)] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.utils.core :as utils])) (defn- callback diff --git a/src/status_im/ui/components/badge.cljs b/src/status_im/ui/components/badge.cljs index 652cb8146b..2e9e92d484 100644 --- a/src/status_im/ui/components/badge.cljs +++ b/src/status_im/ui/components/badge.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.components.badge (:require [quo.design-system.colors :as colors] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react])) (defn badge diff --git a/src/status_im/ui/components/common/common.cljs b/src/status_im/ui/components/common/common.cljs index 69588dacd9..7b2437fe39 100644 --- a/src/status_im/ui/components/common/common.cljs +++ b/src/status_im/ui/components/common/common.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.components.common.common (:require [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.common.styles :as styles] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react]) diff --git a/src/status_im/ui/components/connectivity/view.cljs b/src/status_im/ui/components/connectivity/view.cljs index e91dca1e94..a833d01a98 100644 --- a/src/status_im/ui/components/connectivity/view.cljs +++ b/src/status_im/ui/components/connectivity/view.cljs @@ -3,7 +3,7 @@ [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.animation :as animation] [status-im.ui.components.react :as react]) (:require-macros [status-im.utils.views :as views :refer [defview letsubs]])) diff --git a/src/status_im/ui/components/copyable_text.cljs b/src/status_im/ui/components/copyable_text.cljs index 8bb5ded708..5576ad3412 100644 --- a/src/status_im/ui/components/copyable_text.cljs +++ b/src/status_im/ui/components/copyable_text.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.components.copyable-text (:require [quo.design-system.colors :as colors] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.animation :as animation] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/components/invite/events.cljs b/src/status_im/ui/components/invite/events.cljs index 9df27b3fe7..ae8b60940a 100644 --- a/src/status_im/ui/components/invite/events.cljs +++ b/src/status_im/ui/components/invite/events.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.components.invite.events (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [utils.re-frame :as rf] [status-im.utils.universal-links.utils :as universal-links])) diff --git a/src/status_im/ui/components/invite/views.cljs b/src/status_im/ui/components/invite/views.cljs index 89d3d88fbd..7b6486e18a 100644 --- a/src/status_im/ui/components/invite/views.cljs +++ b/src/status_im/ui/components/invite/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.components.invite.views (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.invite.events :as invite.events])) (defn button diff --git a/src/status_im/ui/components/list_selection.cljs b/src/status_im/ui/components/list_selection.cljs index 356eb91c8a..2122373e73 100644 --- a/src/status_im/ui/components/list_selection.cljs +++ b/src/status_im/ui/components/list_selection.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.components.list-selection (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.action-sheet :as action-sheet] [status-im.ui.components.dialog :as dialog] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/components/react.cljs b/src/status_im/ui/components/react.cljs index 393e032170..0580677c79 100644 --- a/src/status_im/ui/components/react.cljs +++ b/src/status_im/ui/components/react.cljs @@ -12,7 +12,7 @@ (SafeAreaProvider SafeAreaInsetsContext)] [quo.design-system.colors :as colors] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.typography :as typography] [status-im.utils.platform :as platform] [status-im.utils.utils :as utils]) diff --git a/src/status_im/ui/components/search_input/view.cljs b/src/status_im/ui/components/search_input/view.cljs index 98dd9535c3..7db567f7f9 100644 --- a/src/status_im/ui/components/search_input/view.cljs +++ b/src/status_im/ui/components/search_input/view.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [quo2.foundations.colors :as quo2.colors] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n])) + [i18n.i18n :as i18n])) (defn search-input [{:keys [search-active?]}] diff --git a/src/status_im/ui/screens/about_app/views.cljs b/src/status_im/ui/screens/about_app/views.cljs index 40e199c710..831acf9685 100644 --- a/src/status_im/ui/screens/about_app/views.cljs +++ b/src/status_im/ui/screens/about_app/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :refer [principles-link privacy-policy-link terms-of-service-link]] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.copyable-text :as copyable-text] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/add_new/new_chat/views.cljs b/src/status_im/ui/screens/add_new/new_chat/views.cljs index 3a4584cc7f..748a841170 100644 --- a/src/status_im/ui/screens/add_new/new_chat/views.cljs +++ b/src/status_im/ui/screens/add_new/new_chat/views.cljs @@ -8,7 +8,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.ethereum.ens :as ens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.qr-scanner.core :as qr-scanner] [status-im.ui.components.animation :as animation] diff --git a/src/status_im/ui/screens/add_new/new_public_chat/view.cljs b/src/status_im/ui/screens/add_new/new_public_chat/view.cljs index 46ac12d0c6..3ace37e704 100644 --- a/src/status_im/ui/screens/add_new/new_public_chat/view.cljs +++ b/src/status_im/ui/screens/add_new/new_public_chat/view.cljs @@ -4,8 +4,7 @@ [re-frame.core :as re-frame] [status-im.add-new.db :as db] [status-im.chat.models :as chat.models] - [status-im.i18n.i18n :as i18n] - [status-im.i18n.i18n-resources :as i18n-resources] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react]) @@ -74,8 +73,8 @@ (defn get-language-topic [] - (let [lang (subs (name i18n-resources/default-device-language) 0 2) - lang3 (subs (name i18n-resources/default-device-language) 0 3) + (let [lang (subs (name i18n/default-device-language) 0 2) + lang3 (subs (name i18n/default-device-language) 0 3) lang-name (or (get lang-names lang3) (get lang-names lang))] (when-not (= lang "en") (or lang-name (str "status-" lang))))) diff --git a/src/status_im/ui/screens/advanced_settings/views.cljs b/src/status_im/ui/screens/advanced_settings/views.cljs index 75335d1dbd..0e9f71e01b 100644 --- a/src/status_im/ui/screens/advanced_settings/views.cljs +++ b/src/status_im/ui/screens/advanced_settings/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.advanced-settings.views (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.list.views :as list] [status-im2.setup.config :as config]) (:require-macros [status-im.utils.views :as views])) diff --git a/src/status_im/ui/screens/appearance/views.cljs b/src/status_im/ui/screens/appearance/views.cljs index 1ddc44a027..84f1d496dc 100644 --- a/src/status_im/ui/screens/appearance/views.cljs +++ b/src/status_im/ui/screens/appearance/views.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.react :as react] [status-im.utils.config :as config])) diff --git a/src/status_im/ui/screens/backup_settings/view.cljs b/src/status_im/ui/screens/backup_settings/view.cljs index 62d03c5504..38656757ad 100644 --- a/src/status_im/ui/screens/backup_settings/view.cljs +++ b/src/status_im/ui/screens/backup_settings/view.cljs @@ -3,9 +3,9 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] - [status-im.utils.datetime :as datetime])) + [utils.datetime :as datetime])) (defn perform-backup! [] diff --git a/src/status_im/ui/screens/biometric/views.cljs b/src/status_im/ui/screens/biometric/views.cljs index 340e625368..bcd9ccb4fd 100644 --- a/src/status_im/ui/screens/biometric/views.cljs +++ b/src/status_im/ui/screens/biometric/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.biometric.core :as biometric] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs index ff20c54b44..5b231e4cb2 100644 --- a/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs +++ b/src/status_im/ui/screens/bootnodes_settings/edit_bootnode/views.cljs @@ -2,7 +2,7 @@ (:require [clojure.string :as string] [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scanner] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] diff --git a/src/status_im/ui/screens/bootnodes_settings/views.cljs b/src/status_im/ui/screens/bootnodes_settings/views.cljs index b8999b90fe..51f0960ee8 100644 --- a/src/status_im/ui/screens/bootnodes_settings/views.cljs +++ b/src/status_im/ui/screens/bootnodes_settings/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.bootnodes-settings.views (:require-macros [status-im.utils.views :as views]) (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] [status-im.ui.components.topbar :as topbar] diff --git a/src/status_im/ui/screens/browser/accounts.cljs b/src/status_im/ui/screens/browser/accounts.cljs index bd0c0869ca..dabc77fa7d 100644 --- a/src/status_im/ui/screens/browser/accounts.cljs +++ b/src/status_im/ui/screens/browser/accounts.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.browser.accounts (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/browser/bookmarks/views.cljs b/src/status_im/ui/screens/browser/bookmarks/views.cljs index 48c14c4f39..61d20a6fa7 100644 --- a/src/status_im/ui/screens/browser/bookmarks/views.cljs +++ b/src/status_im/ui/screens/browser/bookmarks/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.keyboard-avoid-presentation :as kb-presentation] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] diff --git a/src/status_im/ui/screens/browser/eip3085/sheet.cljs b/src/status_im/ui/screens/browser/eip3085/sheet.cljs index cf6fbe5253..507a2f5b45 100644 --- a/src/status_im/ui/screens/browser/eip3085/sheet.cljs +++ b/src/status_im/ui/screens/browser/eip3085/sheet.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.copyable-text :as copyable-text] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/browser/eip3326/sheet.cljs b/src/status_im/ui/screens/browser/eip3326/sheet.cljs index 9f7b5feb28..7b755740d0 100644 --- a/src/status_im/ui/screens/browser/eip3326/sheet.cljs +++ b/src/status_im/ui/screens/browser/eip3326/sheet.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.network.core :as network] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/browser/empty_tab/views.cljs b/src/status_im/ui/screens/browser/empty_tab/views.cljs index d54d1ca72d..2bf29c760c 100644 --- a/src/status_im/ui/screens/browser/empty_tab/views.cljs +++ b/src/status_im/ui/screens/browser/empty_tab/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.common.common :as components.common] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/browser/options/views.cljs b/src/status_im/ui/screens/browser/options/views.cljs index d534105863..51340adedf 100644 --- a/src/status_im/ui/screens/browser/options/views.cljs +++ b/src/status_im/ui/screens/browser/options/views.cljs @@ -4,7 +4,7 @@ [re-frame.core :as re-frame] [status-im.browser.core :as browser] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scanner] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/browser/permissions/views.cljs b/src/status_im/ui/screens/browser/permissions/views.cljs index 8befa3dbf0..2614d99112 100644 --- a/src/status_im/ui/screens/browser/permissions/views.cljs +++ b/src/status_im/ui/screens/browser/permissions/views.cljs @@ -4,7 +4,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.browser.permissions :as browser.permissions] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.animation :as anim] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/browser/site_blocked/views.cljs b/src/status_im/ui/screens/browser/site_blocked/views.cljs index a3538d6974..6041ae53ac 100644 --- a/src/status_im/ui/screens/browser/site_blocked/views.cljs +++ b/src/status_im/ui/screens/browser/site_blocked/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] [status-im.ui.screens.browser.site-blocked.styles :as styles]) diff --git a/src/status_im/ui/screens/browser/tabs/views.cljs b/src/status_im/ui/screens/browser/tabs/views.cljs index 67df23883c..1656bcc9be 100644 --- a/src/status_im/ui/screens/browser/tabs/views.cljs +++ b/src/status_im/ui/screens/browser/tabs/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] [status-im.ui.components.plus-button :as components.plus-button] diff --git a/src/status_im/ui/screens/browser/views.cljs b/src/status_im/ui/screens/browser/views.cljs index a98b98c1ff..e069a65553 100644 --- a/src/status_im/ui/screens/browser/views.cljs +++ b/src/status_im/ui/screens/browser/views.cljs @@ -6,7 +6,7 @@ [reagent.core :as reagent] [status-im.browser.core :as browser] [status-im.browser.webview-ref :as webview-ref] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scanner] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.connectivity.view :as connectivity] diff --git a/src/status_im/ui/screens/bug_report.cljs b/src/status_im/ui/screens/bug_report.cljs index 665b806a72..107469ce09 100644 --- a/src/status_im/ui/screens/bug_report.cljs +++ b/src/status_im/ui/screens/bug_report.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.react-native :as react-native] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.topbar :as topbar])) (defn bug-report diff --git a/src/status_im/ui/screens/chat/audio_message/views.cljs b/src/status_im/ui/screens/chat/audio_message/views.cljs index 842891e79c..069a92ede0 100644 --- a/src/status_im/ui/screens/chat/audio_message/views.cljs +++ b/src/status_im/ui/screens/chat/audio_message/views.cljs @@ -6,7 +6,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.audio.core :as audio] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.native-module.core :as status] [status-im.ui.components.animation :as anim] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/chat/components/contact_request.cljs b/src/status_im/ui/screens/chat/components/contact_request.cljs index d90d84e497..3e982ccbd3 100644 --- a/src/status_im/ui/screens/chat/components/contact_request.cljs +++ b/src/status_im/ui/screens/chat/components/contact_request.cljs @@ -6,7 +6,7 @@ [quo.react-native :as rn] [re-frame.core :as re-frame] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.screens.chat.components.style :as styles]) (:require-macros [status-im.utils.views :refer [defview letsubs]])) diff --git a/src/status_im/ui/screens/chat/components/edit.cljs b/src/status_im/ui/screens/chat/components/edit.cljs index 13618acc4f..f09d57bc0d 100644 --- a/src/status_im/ui/screens/chat/components/edit.cljs +++ b/src/status_im/ui/screens/chat/components/edit.cljs @@ -5,7 +5,7 @@ [quo.react :as quo.react] [quo.react-native :as rn] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.screens.chat.components.style :as styles])) diff --git a/src/status_im/ui/screens/chat/components/input.cljs b/src/status_im/ui/screens/chat/components/input.cljs index 1993237796..0d84b57aa7 100644 --- a/src/status_im/ui/screens/chat/components/input.cljs +++ b/src/status_im/ui/screens/chat/components/input.cljs @@ -11,7 +11,7 @@ [reagent.core :as reagent] [status-im.chat.constants :as chat.constants] [status-im.chat.models.mentions :as mentions] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] diff --git a/src/status_im/ui/screens/chat/components/reply.cljs b/src/status_im/ui/screens/chat/components/reply.cljs index fe1bc669f3..1e7f6f5d57 100644 --- a/src/status_im/ui/screens/chat/components/reply.cljs +++ b/src/status_im/ui/screens/chat/components/reply.cljs @@ -7,7 +7,7 @@ [quo.react-native :as rn] [re-frame.core :as re-frame] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.screens.chat.components.style :as styles])) diff --git a/src/status_im/ui/screens/chat/extensions/views.cljs b/src/status_im/ui/screens/chat/extensions/views.cljs index 48c17da149..7a2806fb3c 100644 --- a/src/status_im/ui/screens/chat/extensions/views.cljs +++ b/src/status_im/ui/screens/chat/extensions/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.chat.extensions.views (:require [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/chat/group.cljs b/src/status_im/ui/screens/chat/group.cljs index f62bacce0a..0605f49ffe 100644 --- a/src/status_im/ui/screens/chat/group.cljs +++ b/src/status_im/ui/screens/chat/group.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.list-selection :as list-selection] [status-im.ui.components.react :as react] [status-im.ui.screens.chat.styles.main :as style] diff --git a/src/status_im/ui/screens/chat/image/views.cljs b/src/status_im/ui/screens/chat/image/views.cljs index 1869e5a0f9..880e51fbe8 100644 --- a/src/status_im/ui/screens/chat/image/views.cljs +++ b/src/status_im/ui/screens/chat/image/views.cljs @@ -5,7 +5,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.permissions :as permissions] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/chat/message/command.cljs b/src/status_im/ui/screens/chat/message/command.cljs index 253fc86b5c..c189906821 100644 --- a/src/status_im/ui/screens/chat/message/command.cljs +++ b/src/status_im/ui/screens/chat/message/command.cljs @@ -4,7 +4,7 @@ [status-im.commands.core :as commands] [status-im.constants :as constants] [status-im.ethereum.transactions.core :as transactions] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/chat/message/gap.cljs b/src/status_im/ui/screens/chat/message/gap.cljs index 230dd16e7a..ffd81eaaa6 100644 --- a/src/status_im/ui/screens/chat/message/gap.cljs +++ b/src/status_im/ui/screens/chat/message/gap.cljs @@ -2,10 +2,10 @@ (:require-macros [status-im.utils.views :as views]) (:require [quo2.core :as quo2] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.screens.chat.styles.input.gap :as style] - [status-im.utils.datetime :as datetime])) + [utils.datetime :as datetime])) (defn on-press [chat-id gap-ids] diff --git a/src/status_im/ui/screens/chat/message/link_preview.cljs b/src/status_im/ui/screens/chat/message/link_preview.cljs index ec7caac776..df018266a2 100644 --- a/src/status_im/ui/screens/chat/message/link_preview.cljs +++ b/src/status_im/ui/screens/chat/message/link_preview.cljs @@ -4,7 +4,7 @@ [re-frame.core :as re-frame] [status-im.chat.models.link-preview :as link-preview] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.react :as react] [status-im.ui.screens.chat.message.styles :as styles] diff --git a/src/status_im/ui/screens/chat/message/message.cljs b/src/status_im/ui/screens/chat/message/message.cljs index 10e6101dc5..bec7d03d0a 100644 --- a/src/status_im/ui/screens/chat/message/message.cljs +++ b/src/status_im/ui/screens/chat/message/message.cljs @@ -6,7 +6,7 @@ [reagent.core :as reagent] [status-im.chat.models.images :as images] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.animation :as animation] [status-im.ui.components.fast-image :as fast-image] diff --git a/src/status_im/ui/screens/chat/message/pinned_message.cljs b/src/status_im/ui/screens/chat/message/pinned_message.cljs index a707b40098..a5a6038fd5 100644 --- a/src/status_im/ui/screens/chat/message/pinned_message.cljs +++ b/src/status_im/ui/screens/chat/message/pinned_message.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] [status-im.ui.screens.chat.message.message :as message] diff --git a/src/status_im/ui/screens/chat/pinned_messages.cljs b/src/status_im/ui/screens/chat/pinned_messages.cljs index 16421e62a4..8777a7222e 100644 --- a/src/status_im/ui/screens/chat/pinned_messages.cljs +++ b/src/status_im/ui/screens/chat/pinned_messages.cljs @@ -3,7 +3,7 @@ [quo.react :as quo.react] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.connectivity.view :as connectivity] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] @@ -12,7 +12,7 @@ [status-im.ui.screens.chat.message.message :as message] [status-im.ui.screens.chat.styles.main :as style] [status-im.ui.screens.chat.views :as chat] - [status-im.utils.datetime :as time] + [utils.datetime :as datetime] [status-im.utils.platform :as platform])) (defn pins-topbar @@ -81,7 +81,7 @@ :edit-enabled edit-enabled :display-username? (not outgoing) :pinned true - :timestamp-str (time/timestamp->time whisper-timestamp)) + :timestamp-str (datetime/timestamp->time whisper-timestamp)) space-keeper]]) (defn pinned-messages-view diff --git a/src/status_im/ui/screens/chat/sheets.cljs b/src/status_im/ui/screens/chat/sheets.cljs index 3e201e8494..3cfbde0538 100644 --- a/src/status_im/ui/screens/chat/sheets.cljs +++ b/src/status_im/ui/screens/chat/sheets.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.list-selection :as list-selection] diff --git a/src/status_im/ui/screens/chat/stickers/views.cljs b/src/status_im/ui/screens/chat/stickers/views.cljs index b9702f7aae..1ab564eba1 100644 --- a/src/status_im/ui/screens/chat/stickers/views.cljs +++ b/src/status_im/ui/screens/chat/stickers/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.fast-image :as fast-image] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/chat/toolbar_content.cljs b/src/status_im/ui/screens/chat/toolbar_content.cljs index de8b93bb67..118f1cd362 100644 --- a/src/status_im/ui/screens/chat/toolbar_content.cljs +++ b/src/status_im/ui/screens/chat/toolbar_content.cljs @@ -2,7 +2,7 @@ (:require [quo.react-native :as rn] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.screens.chat.styles.main :as st])) diff --git a/src/status_im/ui/screens/chat/utils.cljs b/src/status_im/ui/screens/chat/utils.cljs index 1dbabc5403..0a942475ec 100644 --- a/src/status_im/ui/screens/chat/utils.cljs +++ b/src/status_im/ui/screens/chat/utils.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.chat.utils (:require [quo.design-system.colors :as colors] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/chat/views.cljs b/src/status_im/ui/screens/chat/views.cljs index 534b7d679b..68ece6cf14 100644 --- a/src/status_im/ui/screens/chat/views.cljs +++ b/src/status_im/ui/screens/chat/views.cljs @@ -10,7 +10,7 @@ re-frame.db [reagent.core :as reagent] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.connectivity.view :as connectivity] diff --git a/src/status_im/ui/screens/communities/channel_details.cljs b/src/status_im/ui/screens/communities/channel_details.cljs index 9a5e145b82..a35f48145e 100644 --- a/src/status_im/ui/screens/communities/channel_details.cljs +++ b/src/status_im/ui/screens/communities/channel_details.cljs @@ -3,7 +3,7 @@ [quo.core :as quo] [re-frame.core :as re-frame] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.profile-header.view :as profile-header] [utils.re-frame :as rf])) diff --git a/src/status_im/ui/screens/communities/community.cljs b/src/status_im/ui/screens/communities/community.cljs index 3de8adc258..e4acb4d6a4 100644 --- a/src/status_im/ui/screens/communities/community.cljs +++ b/src/status_im/ui/screens/communities/community.cljs @@ -23,7 +23,7 @@ [status-im.ui.screens.chat.sheets :as sheets] [status-im.ui.screens.home.views.inner-item :as inner-item] [status-im.utils.core :as utils] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [utils.re-frame :as rf])) (def request-cooldown-ms (* 24 60 60 1000)) diff --git a/src/status_im/ui/screens/communities/create.cljs b/src/status_im/ui/screens/communities/create.cljs index ac068a3374..d85d152b56 100644 --- a/src/status_im/ui/screens/communities/create.cljs +++ b/src/status_im/ui/screens/communities/create.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [quo.react-native :as rn] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] diff --git a/src/status_im/ui/screens/communities/create_category.cljs b/src/status_im/ui/screens/communities/create_category.cljs index f6faca6b5b..76686e1c79 100644 --- a/src/status_im/ui/screens/communities/create_category.cljs +++ b/src/status_im/ui/screens/communities/create_category.cljs @@ -3,7 +3,7 @@ [quo.core :as quo] [reagent.core :as reagent] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.keyboard-avoid-presentation :as kb-presentation] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/communities/create_channel.cljs b/src/status_im/ui/screens/communities/create_channel.cljs index 10c41cd6c3..d7b25955fa 100644 --- a/src/status_im/ui/screens/communities/create_channel.cljs +++ b/src/status_im/ui/screens/communities/create_channel.cljs @@ -3,7 +3,7 @@ [quo.core :as quo] [quo.react-native :as rn] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.emoji-thumbnail.preview :as emoji-thumbnail-preview] [status-im.ui.components.emoji-thumbnail.styles :as styles] [status-im.ui.components.keyboard-avoid-presentation :as kb-presentation] diff --git a/src/status_im/ui/screens/communities/edit.cljs b/src/status_im/ui/screens/communities/edit.cljs index f79bc56ae2..d0de4b8db1 100644 --- a/src/status_im/ui/screens/communities/edit.cljs +++ b/src/status_im/ui/screens/communities/edit.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.communities.edit (:require [quo.core :as quo] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.toolbar :as toolbar] [status-im.ui.screens.communities.create :as community.create] [utils.re-frame :as rf])) diff --git a/src/status_im/ui/screens/communities/edit_channel.cljs b/src/status_im/ui/screens/communities/edit_channel.cljs index e520c2d10b..f616efb67d 100644 --- a/src/status_im/ui/screens/communities/edit_channel.cljs +++ b/src/status_im/ui/screens/communities/edit_channel.cljs @@ -2,7 +2,7 @@ (:require [clojure.string :as string] [quo.core :as quo] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.toolbar :as toolbar] [status-im.ui.screens.communities.create-channel :as create-channel] [utils.re-frame :as rf] diff --git a/src/status_im/ui/screens/communities/import.cljs b/src/status_im/ui/screens/communities/import.cljs index 71f7f465cb..4635553af3 100644 --- a/src/status_im/ui/screens/communities/import.cljs +++ b/src/status_im/ui/screens/communities/import.cljs @@ -3,7 +3,7 @@ [quo.react-native :as rn] [reagent.core :as reagent] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.toolbar :as toolbar] [utils.re-frame :as rf])) diff --git a/src/status_im/ui/screens/communities/invite.cljs b/src/status_im/ui/screens/communities/invite.cljs index 578cb9206b..e5159fdc94 100644 --- a/src/status_im/ui/screens/communities/invite.cljs +++ b/src/status_im/ui/screens/communities/invite.cljs @@ -5,7 +5,7 @@ [reagent.core :as reagent] [status-im.communities.core :as communities] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.toolbar :as toolbar] diff --git a/src/status_im/ui/screens/communities/members.cljs b/src/status_im/ui/screens/communities/members.cljs index 7b56363996..283f5ca957 100644 --- a/src/status_im/ui/screens/communities/members.cljs +++ b/src/status_im/ui/screens/communities/members.cljs @@ -4,7 +4,7 @@ [reagent.core :as reagent] [status-im.communities.core :as communities] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/communities/membership.cljs b/src/status_im/ui/screens/communities/membership.cljs index 70e18d296b..e699b4c92b 100644 --- a/src/status_im/ui/screens/communities/membership.cljs +++ b/src/status_im/ui/screens/communities/membership.cljs @@ -3,7 +3,7 @@ [quo.react-native :as rn] [status-im.communities.core :as communities] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.toolbar :as toolbar] [utils.re-frame :as rf])) diff --git a/src/status_im/ui/screens/communities/profile.cljs b/src/status_im/ui/screens/communities/profile.cljs index ef4aeec73a..f569690ee3 100644 --- a/src/status_im/ui/screens/communities/profile.cljs +++ b/src/status_im/ui/screens/communities/profile.cljs @@ -6,7 +6,7 @@ [reagent.core :as reagent] [status-im.communities.core :as communities] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.copyable-text :as copyable-text] [status-im.ui.components.profile-header.view :as profile-header] diff --git a/src/status_im/ui/screens/communities/reorder_categories.cljs b/src/status_im/ui/screens/communities/reorder_categories.cljs index 1d1e8be109..e22b65785f 100644 --- a/src/status_im/ui/screens/communities/reorder_categories.cljs +++ b/src/status_im/ui/screens/communities/reorder_categories.cljs @@ -9,7 +9,7 @@ [reagent.core :as reagent] [status-im.communities.core :as communities] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] [status-im.ui.components.tabs :as tabs] diff --git a/src/status_im/ui/screens/communities/requests_to_join.cljs b/src/status_im/ui/screens/communities/requests_to_join.cljs index f0c2700bde..a46edea66f 100644 --- a/src/status_im/ui/screens/communities/requests_to_join.cljs +++ b/src/status_im/ui/screens/communities/requests_to_join.cljs @@ -6,7 +6,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/communities/select_category.cljs b/src/status_im/ui/screens/communities/select_category.cljs index eb3ab2789f..c9fc1fdc72 100644 --- a/src/status_im/ui/screens/communities/select_category.cljs +++ b/src/status_im/ui/screens/communities/select_category.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [reagent.core :as reagent] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/communities/views.cljs b/src/status_im/ui/screens/communities/views.cljs index 870a0e5ace..36cb8e267a 100644 --- a/src/status_im/ui/screens/communities/views.cljs +++ b/src/status_im/ui/screens/communities/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as quo.colors] [status-im.communities.core :as communities] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.badge :as badge] [status-im.ui.components.copyable-text :as copyable-text] [status-im.ui.components.list.views :as list] diff --git a/src/status_im/ui/screens/contacts_list/views.cljs b/src/status_im/ui/screens/contacts_list/views.cljs index a8eb292173..3149304307 100644 --- a/src/status_im/ui/screens/contacts_list/views.cljs +++ b/src/status_im/ui/screens/contacts_list/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.invite.views :as invite] diff --git a/src/status_im/ui/screens/dapps_permissions/views.cljs b/src/status_im/ui/screens/dapps_permissions/views.cljs index 33777dd2ee..abddc2b205 100644 --- a/src/status_im/ui/screens/dapps_permissions/views.cljs +++ b/src/status_im/ui/screens/dapps_permissions/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/default_sync_period_settings/view.cljs b/src/status_im/ui/screens/default_sync_period_settings/view.cljs index 75d9aad916..282beb92cd 100644 --- a/src/status_im/ui/screens/default_sync_period_settings/view.cljs +++ b/src/status_im/ui/screens/default_sync_period_settings/view.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.utils.config :as config])) diff --git a/src/status_im/ui/screens/ens/views.cljs b/src/status_im/ui/screens/ens/views.cljs index ab9ef47305..7850545876 100644 --- a/src/status_im/ui/screens/ens/views.cljs +++ b/src/status_im/ui/screens/ens/views.cljs @@ -11,7 +11,7 @@ [status-im.ethereum.ens :as ethereum.ens] [status-im.ethereum.stateofus :as stateofus] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.react-native.resources :as resources] [status-im.ui.components.chat-icon.screen :as chat-icon] diff --git a/src/status_im/ui/screens/glossary/view.cljs b/src/status_im/ui/screens/glossary/view.cljs index 9fdc054b38..a2803ee3ad 100644 --- a/src/status_im/ui/screens/glossary/view.cljs +++ b/src/status_im/ui/screens/glossary/view.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.screens.glossary.view (:require [quo.design-system.colors :as colors] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/group/views.cljs b/src/status_im/ui/screens/group/views.cljs index 0e61906500..ccf7ded73f 100644 --- a/src/status_im/ui/screens/group/views.cljs +++ b/src/status_im/ui/screens/group/views.cljs @@ -4,7 +4,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.invite.views :as invite] diff --git a/src/status_im/ui/screens/help_center/views.cljs b/src/status_im/ui/screens/help_center/views.cljs index 454d409b32..0b53629420 100644 --- a/src/status_im/ui/screens/help_center/views.cljs +++ b/src/status_im/ui/screens/help_center/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/home/sheet/views.cljs b/src/status_im/ui/screens/home/sheet/views.cljs index 36bf6e35e4..053edca6bf 100644 --- a/src/status_im/ui/screens/home/sheet/views.cljs +++ b/src/status_im/ui/screens/home/sheet/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo2.foundations.colors :as colors] [re-frame.core :as rf] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scanner] [status-im.ui.components.invite.views :as invite] [status-im.ui.components.react :as rn] diff --git a/src/status_im/ui/screens/home/views.cljs b/src/status_im/ui/screens/home/views.cljs index 646a0a6227..2104528bd3 100644 --- a/src/status_im/ui/screens/home/views.cljs +++ b/src/status_im/ui/screens/home/views.cljs @@ -9,7 +9,7 @@ [reagent.core :as reagent] [status-im.add-new.core :as new-chat] [status-im.add-new.db :as db] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scanner] [status-im.react-native.resources :as resources] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] diff --git a/src/status_im/ui/screens/home/views/inner_item.cljs b/src/status_im/ui/screens/home/views/inner_item.cljs index bb3c6063d7..f727da7fb9 100644 --- a/src/status_im/ui/screens/home/views/inner_item.cljs +++ b/src/status_im/ui/screens/home/views/inner_item.cljs @@ -6,7 +6,7 @@ [quo2.foundations.colors :as quo2.colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.badge :as badge] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.chat-icon.styles :as chat-icon.styles] @@ -14,7 +14,7 @@ [status-im.ui.components.react :as react] [status-im.ui.screens.home.styles :as styles] [status-im.utils.core :as utils] - [status-im.utils.datetime :as time] + [utils.datetime :as datetime] [status-im.utils.utils :as utils.utils])) (defn preview-label @@ -123,7 +123,7 @@ (def memo-timestamp (memoize (fn [timestamp] - (string/upper-case (time/to-short-str timestamp))))) + (string/upper-case (datetime/to-short-str timestamp))))) (defn unviewed-indicator [{:keys [unviewed-mentions-count diff --git a/src/status_im/ui/screens/keycard/authentication_method/views.cljs b/src/status_im/ui/screens/keycard/authentication_method/views.cljs index b58aecf448..42d09b51a0 100644 --- a/src/status_im/ui/screens/keycard/authentication_method/views.cljs +++ b/src/status_im/ui/screens/keycard/authentication_method/views.cljs @@ -2,7 +2,7 @@ (:require [quo.components.separator :as separator] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/keycard/components/turn_nfc.cljs b/src/status_im/ui/screens/keycard/components/turn_nfc.cljs index 2acc540c5c..420cd77703 100644 --- a/src/status_im/ui/screens/keycard/components/turn_nfc.cljs +++ b/src/status_im/ui/screens/keycard/components/turn_nfc.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] [status-im.ui.screens.keycard.components.style :as styles])) diff --git a/src/status_im/ui/screens/keycard/frozen_card/view.cljs b/src/status_im/ui/screens/keycard/frozen_card/view.cljs index 01db6d893c..c34da955ec 100644 --- a/src/status_im/ui/screens/keycard/frozen_card/view.cljs +++ b/src/status_im/ui/screens/keycard/frozen_card/view.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.login :as login] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/keycard/keycard_interaction.cljs b/src/status_im/ui/screens/keycard/keycard_interaction.cljs index 24551e96f7..5d54426ca7 100644 --- a/src/status_im/ui/screens/keycard/keycard_interaction.cljs +++ b/src/status_im/ui/screens/keycard/keycard_interaction.cljs @@ -2,7 +2,7 @@ (:require [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.screens.keycard.components.description :as description] [status-im.ui.screens.keycard.components.keycard-animation :refer [animated-circles]] diff --git a/src/status_im/ui/screens/keycard/onboarding/views.cljs b/src/status_im/ui/screens/keycard/onboarding/views.cljs index b683523f14..717b489d29 100644 --- a/src/status_im/ui/screens/keycard/onboarding/views.cljs +++ b/src/status_im/ui/screens/keycard/onboarding/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.onboarding :as keycard.onboarding] [status-im.react-native.resources :as resources] [status-im.ui.components.checkbox.view :as checkbox] diff --git a/src/status_im/ui/screens/keycard/pairing/views.cljs b/src/status_im/ui/screens/keycard/pairing/views.cljs index 26dcba9af5..ce9a40467b 100644 --- a/src/status_im/ui/screens/keycard/pairing/views.cljs +++ b/src/status_im/ui/screens/keycard/pairing/views.cljs @@ -3,7 +3,7 @@ [quo.react-native :as rn] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.toolbar :as toolbar] [utils.security.core :as security])) diff --git a/src/status_im/ui/screens/keycard/pin/views.cljs b/src/status_im/ui/screens/keycard/pin/views.cljs index 1568034c7a..7b86cff7cb 100644 --- a/src/status_im/ui/screens/keycard/pin/views.cljs +++ b/src/status_im/ui/screens/keycard/pin/views.cljs @@ -3,7 +3,7 @@ (:require [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.animation :as animation] [status-im.ui.components.checkbox.view :as checkbox] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/keycard/recovery/views.cljs b/src/status_im/ui/screens/keycard/recovery/views.cljs index fff853dd40..5f4d182b6b 100644 --- a/src/status_im/ui/screens/keycard/recovery/views.cljs +++ b/src/status_im/ui/screens/keycard/recovery/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.recovery :as keycard.recovery] [status-im.react-native.resources :as resources] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/keycard/settings/views.cljs b/src/status_im/ui/screens/keycard/settings/views.cljs index e075edaddc..0aae7cd95a 100644 --- a/src/status_im/ui/screens/keycard/settings/views.cljs +++ b/src/status_im/ui/screens/keycard/settings/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.react :as react] [status-im.ui.screens.keycard.views :as keycard.views])) diff --git a/src/status_im/ui/screens/keycard/views.cljs b/src/status_im/ui/screens/keycard/views.cljs index a5aec11465..04dcaad07d 100644 --- a/src/status_im/ui/screens/keycard/views.cljs +++ b/src/status_im/ui/screens/keycard/views.cljs @@ -6,7 +6,7 @@ [reagent.core :as reagent] [status-im.bottom-sheet.core :as bottom-sheet] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.login :as keycard.login] [status-im.multiaccounts.core :as multiaccounts] [status-im.multiaccounts.create.core :as multiaccounts.create] diff --git a/src/status_im/ui/screens/link_previews_settings/views.cljs b/src/status_im/ui/screens/link_previews_settings/views.cljs index 4fdb1ef12f..9b95b4a8a9 100644 --- a/src/status_im/ui/screens/link_previews_settings/views.cljs +++ b/src/status_im/ui/screens/link_previews_settings/views.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [status-im.chat.models.link-preview :as link-preview] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/mobile_network_settings/sheets.cljs b/src/status_im/ui/screens/mobile_network_settings/sheets.cljs index 53a08222fd..00e5df70b1 100644 --- a/src/status_im/ui/screens/mobile_network_settings/sheets.cljs +++ b/src/status_im/ui/screens/mobile_network_settings/sheets.cljs @@ -2,7 +2,7 @@ (:require-macros [status-im.utils.views :as views]) (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.checkbox.view :as checkbox] [status-im.ui.components.react :as react] [status-im.ui.screens.mobile-network-settings.sheets-styles :as styles])) diff --git a/src/status_im/ui/screens/mobile_network_settings/view.cljs b/src/status_im/ui/screens/mobile_network_settings/view.cljs index 9a5321b7f6..1305c45fc2 100644 --- a/src/status_im/ui/screens/mobile_network_settings/view.cljs +++ b/src/status_im/ui/screens/mobile_network_settings/view.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.mobile-network-settings.view (:require-macros [status-im.utils.views :as views]) (:require [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] status-im.mobile-sync-settings.core [status-im.ui.components.react :as react] [status-im.ui.screens.mobile-network-settings.sheets :as sheets] diff --git a/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs b/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs index ccc1cbae9d..47f6dfd90f 100644 --- a/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/key_storage/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [re-frame.db] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.multiaccounts.key-storage.core :as multiaccounts.key-storage] [status-im.react-native.resources :as resources] diff --git a/src/status_im/ui/screens/multiaccounts/login/views.cljs b/src/status_im/ui/screens/multiaccounts/login/views.cljs index cff566c5b0..8f441c456f 100644 --- a/src/status_im/ui/screens/multiaccounts/login/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/login/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.checkbox.view :as checkbox] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/multiaccounts/recover/views.cljs b/src/status_im/ui/screens/multiaccounts/recover/views.cljs index 16097e4959..0f5130a85e 100644 --- a/src/status_im/ui/screens/multiaccounts/recover/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/recover/views.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.recovery :as keycard] [status-im.multiaccounts.key-storage.core :as multiaccounts.key-storage] [status-im.multiaccounts.recover.core :as multiaccounts.recover] diff --git a/src/status_im/ui/screens/multiaccounts/sheets.cljs b/src/status_im/ui/screens/multiaccounts/sheets.cljs index f4dc639e21..9e49e335d7 100644 --- a/src/status_im/ui/screens/multiaccounts/sheets.cljs +++ b/src/status_im/ui/screens/multiaccounts/sheets.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.multiaccounts.sheets (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n])) + [i18n.i18n :as i18n])) (defn actions-sheet [] diff --git a/src/status_im/ui/screens/multiaccounts/views.cljs b/src/status_im/ui/screens/multiaccounts/views.cljs index 0fb548f041..f746ba803b 100644 --- a/src/status_im/ui/screens/multiaccounts/views.cljs +++ b/src/status_im/ui/screens/multiaccounts/views.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.react-native.resources :as resources] [status-im.ui.components.list.views :as list] diff --git a/src/status_im/ui/screens/network/edit_network/views.cljs b/src/status_im/ui/screens/network/edit_network/views.cljs index dff1995166..1079e59dac 100644 --- a/src/status_im/ui/screens/network/edit_network/views.cljs +++ b/src/status_im/ui/screens/network/edit_network/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.network.edit-network.views (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.network.core :as network] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/network/network_details/views.cljs b/src/status_im/ui/screens/network/network_details/views.cljs index 6b8f4dc424..d4c3ec5983 100644 --- a/src/status_im/ui/screens/network/network_details/views.cljs +++ b/src/status_im/ui/screens/network/network_details/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.network.network-details.views (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.network.core :as network] [status-im.ui.components.react :as react] [status-im.ui.screens.network.styles :as st] diff --git a/src/status_im/ui/screens/network/views.cljs b/src/status_im/ui/screens/network/views.cljs index 5c03b477bf..ee27174ef4 100644 --- a/src/status_im/ui/screens/network/views.cljs +++ b/src/status_im/ui/screens/network/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.network.core :as network] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] diff --git a/src/status_im/ui/screens/network_info/views.cljs b/src/status_im/ui/screens/network_info/views.cljs index 0358b23728..d540b8c786 100644 --- a/src/status_im/ui/screens/network_info/views.cljs +++ b/src/status_im/ui/screens/network_info/views.cljs @@ -4,8 +4,8 @@ [status-im.ethereum.decode :as decode] [status-im.native-module.core :as status] [status-im.ui.components.react :as react] - [status-im.utils.datetime :as time] - [status-im2.common.json-rpc.events :as json-rpc])) + [status-im2.common.json-rpc.events :as json-rpc] + [utils.datetime :as datetime])) (defn get-block [block callback] @@ -21,7 +21,7 @@ (defn to-date [timestamp] - (time/timestamp->long-date + (datetime/timestamp->long-date (* 1000 timestamp))) (defn check-lag diff --git a/src/status_im/ui/screens/notifications_settings/views.cljs b/src/status_im/ui/screens/notifications_settings/views.cljs index d9bd346ef1..359c634499 100644 --- a/src/status_im/ui/screens/notifications_settings/views.cljs +++ b/src/status_im/ui/screens/notifications_settings/views.cljs @@ -5,7 +5,7 @@ [quo.platform :as platform] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.notifications.core :as notifications] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/views.cljs b/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/views.cljs index b70767378a..71f5e785d6 100644 --- a/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/views.cljs +++ b/src/status_im/ui/screens/offline_messaging_settings/edit_mailserver/views.cljs @@ -3,7 +3,7 @@ (:require [clojure.string :as string] [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scanner] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] diff --git a/src/status_im/ui/screens/offline_messaging_settings/views.cljs b/src/status_im/ui/screens/offline_messaging_settings/views.cljs index c9e462280c..3dda76f608 100644 --- a/src/status_im/ui/screens/offline_messaging_settings/views.cljs +++ b/src/status_im/ui/screens/offline_messaging_settings/views.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/onboarding/intro/views.cljs b/src/status_im/ui/screens/onboarding/intro/views.cljs index 9426cc4e7f..5dda706129 100644 --- a/src/status_im/ui/screens/onboarding/intro/views.cljs +++ b/src/status_im/ui/screens/onboarding/intro/views.cljs @@ -6,7 +6,7 @@ [quo.react-native :as rn] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.react :as react] [status-im.ui.screens.onboarding.intro.styles :as styles])) diff --git a/src/status_im/ui/screens/onboarding/keys/views.cljs b/src/status_im/ui/screens/onboarding/keys/views.cljs index 866ba5576a..b95b087147 100644 --- a/src/status_im/ui/screens/onboarding/keys/views.cljs +++ b/src/status_im/ui/screens/onboarding/keys/views.cljs @@ -3,7 +3,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.react :as react] [status-im.ui.components.topbar :as topbar] diff --git a/src/status_im/ui/screens/onboarding/notifications/views.cljs b/src/status_im/ui/screens/onboarding/notifications/views.cljs index dbef92d1ad..90830331f1 100644 --- a/src/status_im/ui/screens/onboarding/notifications/views.cljs +++ b/src/status_im/ui/screens/onboarding/notifications/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [quo.platform :as platform] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.notifications.core :as notifications] [status-im.react-native.resources :as resources] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/onboarding/password/views.cljs b/src/status_im/ui/screens/onboarding/password/views.cljs index f12155bb0c..e54fef126b 100644 --- a/src/status_im/ui/screens/onboarding/password/views.cljs +++ b/src/status_im/ui/screens/onboarding/password/views.cljs @@ -4,7 +4,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.constants :as const] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.toolbar :as toolbar] [utils.security.core :as security])) diff --git a/src/status_im/ui/screens/onboarding/phrase/view.cljs b/src/status_im/ui/screens/onboarding/phrase/view.cljs index 231adcad92..4370903770 100644 --- a/src/status_im/ui/screens/onboarding/phrase/view.cljs +++ b/src/status_im/ui/screens/onboarding/phrase/view.cljs @@ -4,10 +4,10 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.screens.onboarding.views :as ui] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [status-im.utils.utils :as utils] [utils.debounce :refer [dispatch-and-chill]] [utils.security.core :as security])) diff --git a/src/status_im/ui/screens/onboarding/storage/views.cljs b/src/status_im/ui/screens/onboarding/storage/views.cljs index cbae1e7ddd..0bee58b171 100644 --- a/src/status_im/ui/screens/onboarding/storage/views.cljs +++ b/src/status_im/ui/screens/onboarding/storage/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.onboarding.storage.views (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.screens.onboarding.views :as ui] [utils.debounce :refer [dispatch-and-chill]]) diff --git a/src/status_im/ui/screens/onboarding/views.cljs b/src/status_im/ui/screens/onboarding/views.cljs index c0fac1417b..6d38152d6c 100644 --- a/src/status_im/ui/screens/onboarding/views.cljs +++ b/src/status_im/ui/screens/onboarding/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] [status-im.ui.screens.onboarding.styles :as styles])) diff --git a/src/status_im/ui/screens/onboarding/welcome/views.cljs b/src/status_im/ui/screens/onboarding/welcome/views.cljs index cb210aed23..e2027ad82b 100644 --- a/src/status_im/ui/screens/onboarding/welcome/views.cljs +++ b/src/status_im/ui/screens/onboarding/welcome/views.cljs @@ -3,7 +3,7 @@ [quo.core :as quo] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.react :as react] [status-im.ui.screens.onboarding.welcome.styles :as styles])) diff --git a/src/status_im/ui/screens/pairing/views.cljs b/src/status_im/ui/screens/pairing/views.cljs index c35db94afc..da5b738422 100644 --- a/src/status_im/ui/screens/pairing/views.cljs +++ b/src/status_im/ui/screens/pairing/views.cljs @@ -4,7 +4,7 @@ [quo.core :as quo] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/peers_stats.cljs b/src/status_im/ui/screens/peers_stats.cljs index ad3a03eb72..4dc14757c6 100644 --- a/src/status_im/ui/screens/peers_stats.cljs +++ b/src/status_im/ui/screens/peers_stats.cljs @@ -1,6 +1,6 @@ (ns status-im.ui.screens.peers-stats (:require [react-native.core :as react-native.core] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [utils.re-frame :as re-frame])) (defn peers-stats diff --git a/src/status_im/ui/screens/privacy_and_security_settings/delete_profile.cljs b/src/status_im/ui/screens/privacy_and_security_settings/delete_profile.cljs index 70e1cf2cd4..c1ff7c5eb9 100644 --- a/src/status_im/ui/screens/privacy_and_security_settings/delete_profile.cljs +++ b/src/status_im/ui/screens/privacy_and_security_settings/delete_profile.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] status-im.keycard.delete-key [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] diff --git a/src/status_im/ui/screens/privacy_and_security_settings/events.cljs b/src/status_im/ui/screens/privacy_and_security_settings/events.cljs index 0e8cc2d132..bf4e082f87 100644 --- a/src/status_im/ui/screens/privacy_and_security_settings/events.cljs +++ b/src/status_im/ui/screens/privacy_and_security_settings/events.cljs @@ -2,7 +2,7 @@ (:require [clojure.string :as string] [re-frame.core :as re-frame] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.native-module.core :as status] [utils.re-frame :as rf] [status-im.utils.types :as types] diff --git a/src/status_im/ui/screens/privacy_and_security_settings/messages_from_contacts_only.cljs b/src/status_im/ui/screens/privacy_and_security_settings/messages_from_contacts_only.cljs index 153826d06d..9b9a794e90 100644 --- a/src/status_im/ui/screens/privacy_and_security_settings/messages_from_contacts_only.cljs +++ b/src/status_im/ui/screens/privacy_and_security_settings/messages_from_contacts_only.cljs @@ -2,7 +2,7 @@ (:require-macros [status-im.utils.views :as views]) (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.ui.components.react :as react] [utils.re-frame :as rf])) diff --git a/src/status_im/ui/screens/privacy_and_security_settings/views.cljs b/src/status_im/ui/screens/privacy_and_security_settings/views.cljs index 2c5bcacfe3..75eb8f7d19 100644 --- a/src/status_im/ui/screens/privacy_and_security_settings/views.cljs +++ b/src/status_im/ui/screens/privacy_and_security_settings/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.biometric.core :as biometric] [status-im.multiaccounts.key-storage.core :as key-storage] [status-im.multiaccounts.reset-password.core :as reset-password] diff --git a/src/status_im/ui/screens/profile/components/sheets.cljs b/src/status_im/ui/screens/profile/components/sheets.cljs index 7ff26b7458..2b388283ea 100644 --- a/src/status_im/ui/screens/profile/components/sheets.cljs +++ b/src/status_im/ui/screens/profile/components/sheets.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.screens.profile.components.styles :as styles]) (:require-macros [status-im.utils.views :as views])) diff --git a/src/status_im/ui/screens/profile/components/views.cljs b/src/status_im/ui/screens/profile/components/views.cljs index 0eb61eb6b9..dd21acbaed 100644 --- a/src/status_im/ui/screens/profile/components/views.cljs +++ b/src/status_im/ui/screens/profile/components/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.profile.components.views (:require [clojure.string :as string] [quo.design-system.colors :as colors] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] [status-im.ui.screens.profile.components.styles :as styles])) diff --git a/src/status_im/ui/screens/profile/contact/views.cljs b/src/status_im/ui/screens/profile/contact/views.cljs index cc014bdb88..62b7d6b821 100644 --- a/src/status_im/ui/screens/profile/contact/views.cljs +++ b/src/status_im/ui/screens/profile/contact/views.cljs @@ -6,7 +6,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.chat.models :as chat.models] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/profile/group_chat/views.cljs b/src/status_im/ui/screens/profile/group_chat/views.cljs index 3b08e7454f..17151b357f 100644 --- a/src/status_im/ui/screens/profile/group_chat/views.cljs +++ b/src/status_im/ui/screens/profile/group_chat/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.common.common :as components.common] diff --git a/src/status_im/ui/screens/profile/seed/views.cljs b/src/status_im/ui/screens/profile/seed/views.cljs index cdbb090fc6..ee3c99d68b 100644 --- a/src/status_im/ui/screens/profile/seed/views.cljs +++ b/src/status_im/ui/screens/profile/seed/views.cljs @@ -4,7 +4,7 @@ [quo.core :as quo] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.common.styles :as components.common.styles] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/profile/user/edit_picture.cljs b/src/status_im/ui/screens/profile/user/edit_picture.cljs index 9143430caa..6ba2c2a7cb 100644 --- a/src/status_im/ui/screens/profile/user/edit_picture.cljs +++ b/src/status_im/ui/screens/profile/user/edit_picture.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.profile.user.edit-picture (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.react :as react] [status-im.utils.config :as config])) diff --git a/src/status_im/ui/screens/profile/user/views.cljs b/src/status_im/ui/screens/profile/user/views.cljs index 5ff21ab870..958f83f2b8 100644 --- a/src/status_im/ui/screens/profile/user/views.cljs +++ b/src/status_im/ui/screens/profile/user/views.cljs @@ -5,7 +5,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.common.common :as components.common] [status-im.ui.components.copyable-text :as copyable-text] diff --git a/src/status_im/ui/screens/profile/visibility_status/utils.cljs b/src/status_im/ui/screens/profile/visibility_status/utils.cljs index 55988789aa..4ca78d9666 100644 --- a/src/status_im/ui/screens/profile/visibility_status/utils.cljs +++ b/src/status_im/ui/screens/profile/visibility_status/utils.cljs @@ -3,9 +3,9 @@ [quo.design-system.colors :as colors] [quo2.foundations.colors :as quo2.colors] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.screens.profile.visibility-status.styles :as styles] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [utils.re-frame :as rf])) ;; Specs: diff --git a/src/status_im/ui/screens/qr_scanner/views.cljs b/src/status_im/ui/screens/qr_scanner/views.cljs index b2d90ba1c9..426adac9ba 100644 --- a/src/status_im/ui/screens/qr_scanner/views.cljs +++ b/src/status_im/ui/screens/qr_scanner/views.cljs @@ -6,7 +6,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.components.topbar :as topbar] [status-im.ui.screens.qr-scanner.styles :as styles] diff --git a/src/status_im/ui/screens/reset_password/views.cljs b/src/status_im/ui/screens/reset_password/views.cljs index c2511cc8ac..435a2c9b3d 100644 --- a/src/status_im/ui/screens/reset_password/views.cljs +++ b/src/status_im/ui/screens/reset_password/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.reset-password.core :as reset-password] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/rpc_usage_info.cljs b/src/status_im/ui/screens/rpc_usage_info.cljs index 776a2ae6f2..98e27a3295 100644 --- a/src/status_im/ui/screens/rpc_usage_info.cljs +++ b/src/status_im/ui/screens/rpc_usage_info.cljs @@ -5,7 +5,7 @@ [quo.react-native :as quo.react-native] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [utils.re-frame :as rf] [status-im.utils.utils :as utils] diff --git a/src/status_im/ui/screens/screens.cljs b/src/status_im/ui/screens/screens.cljs index bcb14e509e..a82038ec52 100644 --- a/src/status_im/ui/screens/screens.cljs +++ b/src/status_im/ui/screens/screens.cljs @@ -2,7 +2,7 @@ (:require [quo.design-system.colors :as colors] [status-im.add-new.core :as new-chat.events] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.screens.about-app.views :as about-app] [status-im.ui.screens.add-new.new-chat.views :as new-chat] diff --git a/src/status_im/ui/screens/signing/sheets.cljs b/src/status_im/ui/screens/signing/sheets.cljs index 0ffea155c5..da0d6bacf1 100644 --- a/src/status_im/ui/screens/signing/sheets.cljs +++ b/src/status_im/ui/screens/signing/sheets.cljs @@ -5,7 +5,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.signing.gas :as gas] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/signing/views.cljs b/src/status_im/ui/screens/signing/views.cljs index 6230311cf5..2876e31b14 100644 --- a/src/status_im/ui/screens/signing/views.cljs +++ b/src/status_im/ui/screens/signing/views.cljs @@ -8,7 +8,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.common :as keycard.common] [status-im.multiaccounts.core :as multiaccounts] [status-im.react-native.resources :as resources] diff --git a/src/status_im/ui/screens/status/new/views.cljs b/src/status_im/ui/screens/status/new/views.cljs index a82597737c..28b1dcb368 100644 --- a/src/status_im/ui/screens/status/new/views.cljs +++ b/src/status_im/ui/screens/status/new/views.cljs @@ -6,7 +6,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.keyboard-avoid-presentation :as kb-presentation] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/status/views.cljs b/src/status_im/ui/screens/status/views.cljs index ccb621257b..fa1323bf84 100644 --- a/src/status_im/ui/screens/status/views.cljs +++ b/src/status_im/ui/screens/status/views.cljs @@ -4,7 +4,7 @@ [reagent.core :as reagent] [status-im.chat.models :as chat] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.fast-image :as fast-image] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] @@ -19,7 +19,7 @@ [status-im.ui.screens.chat.message.reactions-old :as reactions] [status-im.ui.screens.chat.photos :as photos] [status-im.ui.screens.status.styles :as styles] - [status-im.utils.datetime :as datetime])) + [utils.datetime :as datetime])) (defonce messages-list-ref (atom nil)) (def image-max-dimension 192) diff --git a/src/status_im/ui/screens/stickers/views.cljs b/src/status_im/ui/screens/stickers/views.cljs index b6550ec1b6..af2c533eaa 100644 --- a/src/status_im/ui/screens/stickers/views.cljs +++ b/src/status_im/ui/screens/stickers/views.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.stickers.views (:require [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.fast-image :as fast-image] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/sync_settings/views.cljs b/src/status_im/ui/screens/sync_settings/views.cljs index b31908507c..fa0a95d1bf 100644 --- a/src/status_im/ui/screens/sync_settings/views.cljs +++ b/src/status_im/ui/screens/sync_settings/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react])) (views/defview sync-settings diff --git a/src/status_im/ui/screens/terms_of_service/views.cljs b/src/status_im/ui/screens/terms_of_service/views.cljs index 8f1b8ac523..325738b676 100644 --- a/src/status_im/ui/screens/terms_of_service/views.cljs +++ b/src/status_im/ui/screens/terms_of_service/views.cljs @@ -5,7 +5,7 @@ [quo.design-system.typography :as typography] [re-frame.core :as re-frame] [status-im.constants :refer [docs-link]] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/wakuv2_settings/edit_node/views.cljs b/src/status_im/ui/screens/wakuv2_settings/edit_node/views.cljs index f09fe541ef..44d8e83180 100644 --- a/src/status_im/ui/screens/wakuv2_settings/edit_node/views.cljs +++ b/src/status_im/ui/screens/wakuv2_settings/edit_node/views.cljs @@ -2,7 +2,7 @@ (:require [clojure.string :as string] [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] [status-im.ui.components.topbar :as topbar] diff --git a/src/status_im/ui/screens/wakuv2_settings/views.cljs b/src/status_im/ui/screens/wakuv2_settings/views.cljs index 3855e9309d..564a7e130b 100644 --- a/src/status_im/ui/screens/wakuv2_settings/views.cljs +++ b/src/status_im/ui/screens/wakuv2_settings/views.cljs @@ -2,7 +2,7 @@ (:require-macros [status-im.utils.views :as views]) (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] diff --git a/src/status_im/ui/screens/wallet/account/views.cljs b/src/status_im/ui/screens/wallet/account/views.cljs index d9261db5e7..088ebd7bb7 100644 --- a/src/status_im/ui/screens/wallet/account/views.cljs +++ b/src/status_im/ui/screens/wallet/account/views.cljs @@ -10,7 +10,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.animation :as animation] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/wallet/account_settings/views.cljs b/src/status_im/ui/screens/wallet/account_settings/views.cljs index 3d05c73f81..80c08d77cc 100644 --- a/src/status_im/ui/screens/wallet/account_settings/views.cljs +++ b/src/status_im/ui/screens/wallet/account_settings/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.copyable-text :as copyable-text] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/wallet/accounts/sheets.cljs b/src/status_im/ui/screens/wallet/accounts/sheets.cljs index 11293d92c6..ca33ea9086 100644 --- a/src/status_im/ui/screens/wallet/accounts/sheets.cljs +++ b/src/status_im/ui/screens/wallet/accounts/sheets.cljs @@ -1,7 +1,7 @@ (ns status-im.ui.screens.wallet.accounts.sheets (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react])) (defn hide-sheet-and-dispatch diff --git a/src/status_im/ui/screens/wallet/accounts/views.cljs b/src/status_im/ui/screens/wallet/accounts/views.cljs index 868bca7754..afdf4b3e5f 100644 --- a/src/status_im/ui/screens/wallet/accounts/views.cljs +++ b/src/status_im/ui/screens/wallet/accounts/views.cljs @@ -8,7 +8,7 @@ [quo2.foundations.colors :as quo2.colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.keycard.login :as keycard.login] [status-im.qr-scanner.core :as qr-scanner] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/wallet/add_new/views.cljs b/src/status_im/ui/screens/wallet/add_new/views.cljs index f8972a7497..e5b61ec2ba 100644 --- a/src/status_im/ui/screens/wallet/add_new/views.cljs +++ b/src/status_im/ui/screens/wallet/add_new/views.cljs @@ -7,7 +7,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.db :as multiaccounts.db] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/wallet/buy_crypto/views.cljs b/src/status_im/ui/screens/wallet/buy_crypto/views.cljs index 2ecd024453..001b13a7ed 100644 --- a/src/status_im/ui/screens/wallet/buy_crypto/views.cljs +++ b/src/status_im/ui/screens/wallet/buy_crypto/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/wallet/collectibles/views.cljs b/src/status_im/ui/screens/wallet/collectibles/views.cljs index 56fecfbf6f..2bc24803df 100644 --- a/src/status_im/ui/screens/wallet/collectibles/views.cljs +++ b/src/status_im/ui/screens/wallet/collectibles/views.cljs @@ -5,7 +5,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.react-native.resources :as resources] diff --git a/src/status_im/ui/screens/wallet/custom_tokens/views.cljs b/src/status_im/ui/screens/wallet/custom_tokens/views.cljs index 6074aff327..7483a30c87 100644 --- a/src/status_im/ui/screens/wallet/custom_tokens/views.cljs +++ b/src/status_im/ui/screens/wallet/custom_tokens/views.cljs @@ -4,7 +4,7 @@ [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui.components.toolbar :as toolbar] [status-im.ui.components.topbar :as topbar])) diff --git a/src/status_im/ui/screens/wallet/recipient/views.cljs b/src/status_im/ui/screens/wallet/recipient/views.cljs index 934fd00e95..518db9b3b0 100644 --- a/src/status_im/ui/screens/wallet/recipient/views.cljs +++ b/src/status_im/ui/screens/wallet/recipient/views.cljs @@ -6,7 +6,7 @@ [reagent.core :as reagent] [status-im.ethereum.core :as ethereum] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.icons.icons :as icons] diff --git a/src/status_im/ui/screens/wallet/request/views.cljs b/src/status_im/ui/screens/wallet/request/views.cljs index 51bbf9afba..9f380bb431 100644 --- a/src/status_im/ui/screens/wallet/request/views.cljs +++ b/src/status_im/ui/screens/wallet/request/views.cljs @@ -4,7 +4,7 @@ [reagent.core :as reagent] [status-im.ethereum.eip55 :as eip55] [status-im.ethereum.eip681 :as eip681] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.copyable-text :as copyable-text] [status-im.ui.components.qr-code-viewer.views :as qr-code-viewer] [status-im.ui.components.react :as react]) diff --git a/src/status_im/ui/screens/wallet/send/sheets.cljs b/src/status_im/ui/screens/wallet/send/sheets.cljs index 66e0d296d0..153071d619 100644 --- a/src/status_im/ui/screens/wallet/send/sheets.cljs +++ b/src/status_im/ui/screens/wallet/send/sheets.cljs @@ -2,7 +2,7 @@ (:require-macros [status-im.utils.views :as views]) (:require [quo.core :as quo] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/wallet/send/views.cljs b/src/status_im/ui/screens/wallet/send/views.cljs index a7252031c5..c961e5ac1d 100644 --- a/src/status_im/ui/screens/wallet/send/views.cljs +++ b/src/status_im/ui/screens/wallet/send/views.cljs @@ -5,7 +5,7 @@ [re-frame.core :as re-frame] [status-im.commands.core :as commands] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.ui.components.bottom-panel.views :as bottom-panel] [status-im.ui.components.chat-icon.screen :as chat-icon] diff --git a/src/status_im/ui/screens/wallet/settings/views.cljs b/src/status_im/ui/screens/wallet/settings/views.cljs index eff17cb7d5..50bd1da732 100644 --- a/src/status_im/ui/screens/wallet/settings/views.cljs +++ b/src/status_im/ui/screens/wallet/settings/views.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.list.views :as list] [status-im.ui.components.react :as react] diff --git a/src/status_im/ui/screens/wallet/signing_phrase/views.cljs b/src/status_im/ui/screens/wallet/signing_phrase/views.cljs index f85d001e21..8ac589decd 100644 --- a/src/status_im/ui/screens/wallet/signing_phrase/views.cljs +++ b/src/status_im/ui/screens/wallet/signing_phrase/views.cljs @@ -3,7 +3,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.react :as react])) diff --git a/src/status_im/ui/screens/wallet/swap/views.cljs b/src/status_im/ui/screens/wallet/swap/views.cljs index 825cc5ae85..a12e8befad 100644 --- a/src/status_im/ui/screens/wallet/swap/views.cljs +++ b/src/status_im/ui/screens/wallet/swap/views.cljs @@ -4,7 +4,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.keyboard-avoid-presentation :as kb-presentation] diff --git a/src/status_im/ui/screens/wallet/transactions/views.cljs b/src/status_im/ui/screens/wallet/transactions/views.cljs index ccb859f463..f2e83d5a99 100644 --- a/src/status_im/ui/screens/wallet/transactions/views.cljs +++ b/src/status_im/ui/screens/wallet/transactions/views.cljs @@ -2,7 +2,7 @@ (:require [quo.core :as quo] [quo.design-system.colors :as colors] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list-selection :as list-selection] [status-im.ui.components.list.views :as list] diff --git a/src/status_im/ui/screens/wallet_connect/session_proposal/views.cljs b/src/status_im/ui/screens/wallet_connect/session_proposal/views.cljs index c16575409a..2ad17c33ab 100644 --- a/src/status_im/ui/screens/wallet_connect/session_proposal/views.cljs +++ b/src/status_im/ui/screens/wallet_connect/session_proposal/views.cljs @@ -7,7 +7,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.bottom-panel.views :as bottom-panel] [status-im.ui.components.icons.icons :as icons] [status-im.ui.components.list.views :as list] diff --git a/src/status_im/ui2/screens/chat/components/new_chat/view.cljs b/src/status_im/ui2/screens/chat/components/new_chat/view.cljs index fbb142710d..bd17116be4 100644 --- a/src/status_im/ui2/screens/chat/components/new_chat/view.cljs +++ b/src/status_im/ui2/screens/chat/components/new_chat/view.cljs @@ -5,7 +5,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [utils.re-frame :as rf] [status-im.ui.screens.chat.sheets :refer [hide-sheet-and-dispatch]] diff --git a/src/status_im/ui2/screens/chat/composer/input.cljs b/src/status_im/ui2/screens/chat/composer/input.cljs index c5cb4c3847..4b57d6d56f 100644 --- a/src/status_im/ui2/screens/chat/composer/input.cljs +++ b/src/status_im/ui2/screens/chat/composer/input.cljs @@ -10,7 +10,7 @@ [reagent.core :as reagent] [status-im.chat.constants :as chat.constants] [status-im.chat.models.mentions :as mentions] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [status-im.ui2.screens.chat.composer.style :as style] [utils.re-frame :as rf] diff --git a/src/status_im/ui2/screens/chat/messages/message.cljs b/src/status_im/ui2/screens/chat/messages/message.cljs index 7890aaeb94..0c2e16431b 100644 --- a/src/status_im/ui2/screens/chat/messages/message.cljs +++ b/src/status_im/ui2/screens/chat/messages/message.cljs @@ -10,7 +10,7 @@ [re-frame.core :as re-frame] [reagent.core :as reagent] [status-im.constants :as constants] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im.ui.components.fast-image :as fast-image] [status-im.ui.components.react :as react] @@ -25,7 +25,7 @@ [status-im.ui.screens.communities.icon :as communities.icon] [status-im.ui2.screens.chat.components.reply :as components.reply] [status-im.utils.config :as config] - [status-im.utils.datetime :as time] + [utils.datetime :as datetime] [status-im.utils.utils :as utils] [status-im2.contexts.chat.home.chat-list-item.view :as home.chat-list-item] [status-im2.contexts.chat.messages.delete-message-for-me.events] @@ -206,7 +206,7 @@ [text/text props " • "] [text/text (assoc props :accessibility-label :message-timestamp) - (time/to-short-str timestamp)]]))]) + (datetime/to-short-str timestamp)]]))]) (defn message-content-wrapper "Author, userpic and delivery wrapper" diff --git a/src/status_im/utils/clocks.cljs b/src/status_im/utils/clocks.cljs index dd0c66274d..92a37a96b9 100644 --- a/src/status_im/utils/clocks.cljs +++ b/src/status_im/utils/clocks.cljs @@ -1,5 +1,5 @@ (ns status-im.utils.clocks - (:require [status-im.utils.datetime :as utils.datetime])) + (:require [utils.datetime :as datetime])) ;; We use Lamport clocks to ensure correct ordering of events in chats. This is ;; necessary because we operate in a distributed system and there is no central @@ -73,11 +73,11 @@ (defn- ->timestamp-bid [] - (utils.datetime/timestamp)) + (datetime/timestamp)) (defn max-timestamp [] - (+ one-month-in-ms (utils.datetime/timestamp))) + (+ one-month-in-ms (datetime/timestamp))) ; The timestamp has an upper limit of Number.MAX_SAFE_INTEGER ; A malicious client could send a crafted message with timestamp = Number.MAX_SAFE_INTEGER ; which effectively would DoS the chat, as any new message would get diff --git a/src/status_im/utils/currency.cljs b/src/status_im/utils/currency.cljs index e6bc5dacbc..f1ac0cf673 100644 --- a/src/status_im/utils/currency.cljs +++ b/src/status_im/utils/currency.cljs @@ -1,5 +1,5 @@ (ns status-im.utils.currency - (:require [status-im.i18n.i18n :as i18n])) + (:require [i18n.i18n :as i18n])) (def currencies {:aed {:id :aed :code "AED" :display-name (i18n/label :t/currency-display-name-aed) :symbol "د.إ"} diff --git a/src/status_im/utils/datetime_test.cljs b/src/status_im/utils/datetime_test.cljs deleted file mode 100644 index 72979174a1..0000000000 --- a/src/status_im/utils/datetime_test.cljs +++ /dev/null @@ -1,190 +0,0 @@ -(ns status-im.utils.datetime-test - (:require [cljs-time.coerce :as time-coerce] - [cljs-time.core :as t] - [cljs.test :refer-macros [deftest testing is]] - [status-im.goog.i18n :as i18n] - [status-im.utils.datetime :as d])) - -(defn match - [name symbols] - (is (identical? (.-dateTimeSymbols_ (i18n/mk-fmt name #'status-im.utils.datetime/medium-date-format)) - symbols))) - -(deftest date-time-formatter-test - (match "en-US" goog.i18n.DateTimeSymbols_en_US) - (match "en-ZZ" goog.i18n.DateTimeSymbols_en) - (match "en" goog.i18n.DateTimeSymbols_en) - (match "nb-NO" goog.i18n.DateTimeSymbols_nb) - (match "nb" goog.i18n.DateTimeSymbols_nb) - (match "whoa-WHOA" goog.i18n.DateTimeSymbols_en) - (match "whoa" goog.i18n.DateTimeSymbols_en)) - -;; 1970-01-01 00:00:00 UTC -(def epoch 0) -;; 1970-01-03 00:00:00 UTC -(def epoch-plus-3d 172800000) - -(deftest is-24-hour-locale-en-test - (is (= (#'status-im.utils.datetime/is-24-hour-locsym (i18n/locale-symbols "en")) false))) - -(deftest is-24-hour-locale-it-test - (is (= (#'status-im.utils.datetime/is-24-hour-locsym (i18n/locale-symbols "it")) true))) - -(deftest is-24-hour-locale-nb-test - (is (= (#'status-im.utils.datetime/is-24-hour-locsym (i18n/locale-symbols "nb-NO")) true))) - -(deftest to-short-str-today-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/time-fmt (fn [] - (i18n/mk-fmt "us" #'status-im.utils.datetime/short-time-format)) - d/time-zone-offset (t/period :hours 0)] - (is (= (d/to-short-str epoch-plus-3d) "12:00 AM")))) - -#_((deftest to-short-str-today-force-24H-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/is-24-hour (constantly true) - d/time-fmt (i18n-module/mk-fmt "us" d/short-time-format) - d/time-zone-offset (t/period :hours 0)] - (is (= (d/to-short-str epoch-plus-3d) "00:00")))) - - (deftest to-short-str-today-force-AMPM-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/is-24-hour (constantly false) - d/time-fmt (i18n-module/mk-fmt "it" d/short-time-format) - d/time-zone-offset (t/period :hours 0)] - (is (= (d/to-short-str epoch-plus-3d) "12:00 AM"))))) - -(deftest to-short-str-before-yesterday-us-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/time-zone-offset (t/period :hours 0) - d/date-fmt (fn [] - (i18n/mk-fmt "us" #'status-im.utils.datetime/medium-date-format))] - (is (= (d/to-short-str epoch) "Jan 1, 1970")))) - -(deftest to-short-str-before-yesterday-nb-test - (with-redefs [d/time-zone-offset (t/period :hours 0) - d/date-fmt (fn [] - (i18n/mk-fmt "nb-NO" #'status-im.utils.datetime/medium-date-format)) - t/*ms-fn* (constantly epoch-plus-3d)] - (is (= (d/to-short-str epoch) "1. jan. 1970")))) - -(deftest day-relative-before-yesterday-us-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/time-zone-offset (t/period :hours 0) - d/date-fmt (fn [] - (i18n/mk-fmt "us" - #'status-im.utils.datetime/medium-date-time-format))] - (is (= (d/day-relative epoch) "Jan 1, 1970, 12:00:00 AM")))) - -(deftest day-relative-before-yesterday-nb-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/time-zone-offset (t/period :hours 0) - d/date-fmt (fn [] - (i18n/mk-fmt "nb-NO" - #'status-im.utils.datetime/medium-date-time-format))] - (is (= (d/day-relative epoch) "1. jan. 1970, 00:00:00")))) - -(deftest current-year?-test - ;; Today is Monday, 1975-03-10 15:15:45Z - (with-redefs [t/*ms-fn* (constantly 163696545000) - d/time-zone-offset (t/period :hours 0)] - (is (d/current-year? (t/now))) - - (testing "returns false for future years" - (is (not (d/current-year? (t/plus (t/now) (t/years 1)))))) - - (testing "returns true at 1975-01-01 00:00:00" - (is (d/current-year? (time-coerce/from-long 157766400000)))) - - (testing "returns false at 1974-12-31 23:59:59" - (is (not (d/current-year? (time-coerce/from-long 157766399000))))))) - -(deftest previous-years?-test - ;; Today is Monday, 1975-03-10 15:15:45Z - (with-redefs [t/*ms-fn* (constantly 163696545000) - d/time-zone-offset (t/period :hours 0)] - (is (not (d/previous-years? (t/now)))) - - (testing "returns false for future years" - (is (not (d/current-year? (t/plus (t/now) (t/years 1)))))) - - (testing "returns false at 1975-01-01 00:00:00" - (is (not (d/previous-years? (time-coerce/from-long 1640995200000))))) - - (testing "returns true at 1974-12-31 23:59:59" - (is (not (d/previous-years? (time-coerce/from-long 1640995199000))))))) - -(deftest within-last-n-days?-test - ;; Today is Monday, 1975-03-10 15:15:45Z - (let [now 163696545000] - (with-redefs [t/*ms-fn* (constantly now) - d/time-zone-offset (t/period :hours 0)] - (testing "start of the period, 6 days ago (inclusive)" - ;; Tuesday, 1975-03-03 23:59:59Z - (is (not (d/within-last-n-days? (time-coerce/from-long 163123199000) 6))) - - ;; Tuesday, 1975-03-04 00:00:00Z - (is (d/within-last-n-days? (time-coerce/from-long 163123200000) 6)) - - ;; Tuesday, 1975-03-04 00:00:01Z - (is (d/within-last-n-days? (time-coerce/from-long 163123201000) 6))) - - (testing "end of the period (inclusive)" - ;; Monday, 1975-03-10 15:15:44Z - (is (d/within-last-n-days? (time-coerce/from-long 163696544000) 6)) - - ;; Monday, 1975-03-10 15:15:45Z - (is (d/within-last-n-days? (time-coerce/from-long now) 6)) - - ;; Monday, 1975-03-10 15:15:46Z - (is (not (d/within-last-n-days? (time-coerce/from-long 163696546000) 6))))))) - -(deftest timestamp->relative-test - ;; Today is Monday, 1975-03-10 15:15:45Z - (with-redefs [t/*ms-fn* (constantly 163696545000) - d/time-zone-offset (t/period :hours 0) - d/is-24-hour (constantly false)] - (testing "formats previous years" - ;; 1974-12-31 23:59:59Z - (is (= "Dec 31, 1974" (d/timestamp->relative 157766399000))) - ;; 1973-01-01 00:00:00Z - (is (= "Jan 1, 1973" (d/timestamp->relative 94694400000)))) - - (testing "formats 7 days ago or older, but in the current year" - (is (= "03 Mar" (d/timestamp->relative 163091745000))) - (is (= "02 Mar" (d/timestamp->relative 163004400000))) - (is (= "01 Jan" (d/timestamp->relative 157820400000)))) - - (testing "formats dates within the last 6 days" - (is (= "Sat 3:15 PM" (d/timestamp->relative 163523745000))) - (is (= "Fri 3:15 PM" (d/timestamp->relative 163437345000))) - (is (= "Thu 3:15 PM" (d/timestamp->relative 163350945000))) - (is (= "Wed 3:15 PM" (d/timestamp->relative 163264545000))) - (is (= "Tue 3:15 PM" (d/timestamp->relative 163178145000)))) - - (testing "formats within yesterday window" - (is (= "Yesterday 3:15 PM" (d/timestamp->relative 163610145000))) - (is (= "Yesterday 11:59 PM" (d/timestamp->relative 163641599000)))) - - (testing "formats today, at various timestamps" - (is (= "3:15 PM" (d/timestamp->relative 163696545000))) - (is (= "12:00 PM" (d/timestamp->relative 163684800000))) - (is (= "12:00 AM" (d/timestamp->relative 163641600000)))))) - -#_((deftest day-relative-before-yesterday-force-24H-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/is-24-hour (constantly true) - d/time-zone-offset (t/period :hours 0) - d/date-fmt (i18n-module/mk-fmt - "us" - #'status-im.utils.datetime/medium-date-time-format)] - (is (= (d/day-relative epoch) "Jan 1, 1970, 00:00:00")))) - - (deftest day-relative-before-yesterday-force-AMPM-test - (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) - d/is-24-hour (constantly false) - d/time-zone-offset (t/period :hours 0) - d/date-fmt (i18n-module/mk-fmt - "it" - #'status-im.utils.datetime/medium-date-time-format)] - (is (= (d/day-relative epoch) "01 gen 1970, 12:00:00 AM"))))) diff --git a/src/status_im/utils/label.cljs b/src/status_im/utils/label.cljs index fb2dde8c4f..987489b881 100644 --- a/src/status_im/utils/label.cljs +++ b/src/status_im/utils/label.cljs @@ -1,5 +1,5 @@ (ns status-im.utils.label - (:require [status-im.i18n.i18n :as i18n])) + (:require [i18n.i18n :as i18n])) (defn stringify [keyword-or-number] diff --git a/src/status_im/utils/logging/core.cljs b/src/status_im/utils/logging/core.cljs index 31f2b6da15..aaa29c43d8 100644 --- a/src/status_im/utils/logging/core.cljs +++ b/src/status_im/utils/logging/core.cljs @@ -4,13 +4,13 @@ [re-frame.core :as re-frame] [react-native.mail :as react-native-mail] [status-im.bottom-sheet.core :as bottom-sheet] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.native-module.core :as status] [status-im.transport.utils :as transport.utils] [status-im.ui.components.react :as react] [status-im.utils.build :as build] - [status-im.utils.datetime :as datetime] [utils.re-frame :as rf] + [utils.datetime :as datetime] [status-im.utils.platform :as platform] [status-im.utils.types :as types] [status-im2.setup.log :as log])) diff --git a/src/status_im/utils/money.cljs b/src/status_im/utils/money.cljs index 20ddb86034..a49316f864 100644 --- a/src/status_im/utils/money.cljs +++ b/src/status_im/utils/money.cljs @@ -1,7 +1,7 @@ (ns status-im.utils.money (:require ["bignumber.js" :as BigNumber] [clojure.string :as string] - [status-im.i18n.i18n :as i18n])) + [i18n.i18n :as i18n])) ;; The BigNumber version included in web3 sometimes hangs when dividing large ;; numbers Hence we want to use these functions instead of fromWei etc, which diff --git a/src/status_im/utils/random.cljs b/src/status_im/utils/random.cljs index d57c9c8518..d60c983a70 100644 --- a/src/status_im/utils/random.cljs +++ b/src/status_im/utils/random.cljs @@ -1,7 +1,7 @@ (ns status-im.utils.random (:require ["chance" :as Chance] [re-frame.core :as re-frame] - [status-im.utils.datetime :as datetime])) + [utils.datetime :as datetime])) (def chance (Chance.)) diff --git a/src/status_im/utils/universal_links/core.cljs b/src/status_im/utils/universal_links/core.cljs index 79a7e6870a..b666523c05 100644 --- a/src/status_im/utils/universal_links/core.cljs +++ b/src/status_im/utils/universal_links/core.cljs @@ -7,7 +7,7 @@ [status-im.constants :as constants] [status-im.ethereum.core :as ethereum] [status-im.group-chats.core :as group-chats] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.model :as multiaccounts.model] [status-im.router.core :as router] [status-im.ui.components.react :as react] diff --git a/src/status_im/utils/utils.cljs b/src/status_im/utils/utils.cljs index 1b055c7b3a..96a29f75d6 100644 --- a/src/status_im/utils/utils.cljs +++ b/src/status_im/utils/utils.cljs @@ -6,7 +6,7 @@ [re-frame.core :as re-frame] [status-im.ethereum.core :as ethereum] [status-im.ethereum.eip55 :as eip55] - [status-im.i18n.i18n :as i18n])) + [i18n.i18n :as i18n])) ;;TODO (14/11/22 flexsurfer) .-Alert usage code has been moved to the status-im2 namespace, we keep this ;;only for old (status 1.0) code, diff --git a/src/status_im/visibility_status_updates/core.cljs b/src/status_im/visibility_status_updates/core.cljs index 922eca97b7..7d116006f7 100644 --- a/src/status_im/visibility_status_updates/core.cljs +++ b/src/status_im/visibility_status_updates/core.cljs @@ -3,8 +3,8 @@ [status-im.data-store.visibility-status-updates :as visibility-status-updates-store] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.ui.screens.profile.visibility-status.utils :as utils] - [status-im.utils.datetime :as datetime] - [utils.re-frame :as rf])) + [utils.re-frame :as rf] + [utils.datetime :as datetime])) (defn valid-status-type? [status-type] diff --git a/src/status_im/waku/core.cljs b/src/status_im/waku/core.cljs index 42c96c7dde..7a29fcfa54 100644 --- a/src/status_im/waku/core.cljs +++ b/src/status_im/waku/core.cljs @@ -1,7 +1,7 @@ (ns status-im.waku.core (:require [clojure.string :as string] [re-frame.core :as re-frame] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.node.core :as node] [utils.re-frame :as rf] diff --git a/src/status_im/wallet/accounts/core.cljs b/src/status_im/wallet/accounts/core.cljs index 5f86957ce9..ee10668fb0 100644 --- a/src/status_im/wallet/accounts/core.cljs +++ b/src/status_im/wallet/accounts/core.cljs @@ -10,7 +10,7 @@ [status-im.ethereum.eip681 :as eip681] [status-im.ethereum.mnemonic :as mnemonic] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.multiaccounts.key-storage.core :as key-storage] [status-im.multiaccounts.update.core :as multiaccounts.update] diff --git a/src/status_im/wallet/choose_recipient/core.cljs b/src/status_im/wallet/choose_recipient/core.cljs index e8e15caa29..5bdbeb27e0 100644 --- a/src/status_im/wallet/choose_recipient/core.cljs +++ b/src/status_im/wallet/choose_recipient/core.cljs @@ -5,7 +5,7 @@ [status-im.ethereum.core :as ethereum] [status-im.ethereum.eip681 :as eip681] [status-im.ethereum.ens :as ens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.qr-scanner.core :as qr-scaner] [status-im.router.core :as router] [utils.re-frame :as rf] diff --git a/src/status_im/wallet/core.cljs b/src/status_im/wallet/core.cljs index d867a75e16..b9d247fd97 100644 --- a/src/status_im/wallet/core.cljs +++ b/src/status_im/wallet/core.cljs @@ -11,7 +11,7 @@ [status-im.ethereum.ens :as ens] [status-im.ethereum.stateofus :as stateofus] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.update.core :as multiaccounts.update] [status-im.popover.core :as popover.core] [status-im.qr-scanner.core :as qr-scaner] @@ -19,8 +19,8 @@ [status-im.signing.gas :as signing.gas] [status-im.utils.config :as config] [status-im.utils.core :as utils.core] - [status-im.utils.datetime :as datetime] [utils.re-frame :as rf] + [utils.datetime :as datetime] [status-im.utils.mobile-sync :as mobile-network-utils] [status-im.utils.money :as money] [status-im.utils.utils :as utils.utils] diff --git a/src/status_im/wallet/custom_tokens/core.cljs b/src/status_im/wallet/custom_tokens/core.cljs index a50796831c..978cc92985 100644 --- a/src/status_im/wallet/custom_tokens/core.cljs +++ b/src/status_im/wallet/custom_tokens/core.cljs @@ -3,7 +3,7 @@ [quo.design-system.colors :as colors] [re-frame.core :as re-frame] [status-im.ethereum.core :as ethereum] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [utils.re-frame :as rf] [status-im.wallet.core :as wallet] diff --git a/src/status_im/wallet/db.cljs b/src/status_im/wallet/db.cljs index 738ad45cd8..295c604439 100644 --- a/src/status_im/wallet/db.cljs +++ b/src/status_im/wallet/db.cljs @@ -1,5 +1,5 @@ (ns status-im.wallet.db - (:require [status-im.i18n.i18n :as i18n] + (:require [i18n.i18n :as i18n] [status-im.utils.money :as money] [status-im.utils.priority-map :refer [empty-transaction-map]])) diff --git a/src/status_im/wallet/db_test.cljs b/src/status_im/wallet/db_test.cljs index 3e1b90638e..4ccecfe11f 100644 --- a/src/status_im/wallet/db_test.cljs +++ b/src/status_im/wallet/db_test.cljs @@ -1,6 +1,6 @@ (ns status-im.wallet.db-test (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.utils.money :as money] [status-im.wallet.db :as wallet.db])) diff --git a/src/status_im/wallet/recipient/core.cljs b/src/status_im/wallet/recipient/core.cljs index 0784189ddf..dbf671f34b 100644 --- a/src/status_im/wallet/recipient/core.cljs +++ b/src/status_im/wallet/recipient/core.cljs @@ -5,7 +5,7 @@ [status-im.ethereum.eip55 :as eip55] [status-im.ethereum.ens :as ens] [status-im.ethereum.stateofus :as stateofus] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.ui.components.react :as react] [utils.re-frame :as rf] [status-im.utils.random :as random] diff --git a/src/status_im2/contexts/activity_center/notification/contact_request/view.cljs b/src/status_im2/contexts/activity_center/notification/contact_request/view.cljs index 0a5a218ca9..77c5a1601e 100644 --- a/src/status_im2/contexts/activity_center/notification/contact_request/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/contact_request/view.cljs @@ -3,7 +3,7 @@ [quo2.core :as quo] [react-native.core :as rn] [status-im.constants :as constants] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [status-im2.contexts.activity-center.notification.common.view :as common] [utils.re-frame :as rf])) diff --git a/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs b/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs index d161a7f42b..abcdbd25b3 100644 --- a/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/contact_verification/view.cljs @@ -3,7 +3,7 @@ [i18n.i18n :as i18n] [quo2.core :as quo] [status-im.constants :as constants] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [status-im2.contexts.activity-center.notification.common.view :as common] [utils.re-frame :as rf])) diff --git a/src/status_im2/contexts/activity_center/notification/mentions/view.cljs b/src/status_im2/contexts/activity_center/notification/mentions/view.cljs index 6f1e5de245..e7fb8f045f 100644 --- a/src/status_im2/contexts/activity_center/notification/mentions/view.cljs +++ b/src/status_im2/contexts/activity_center/notification/mentions/view.cljs @@ -4,7 +4,7 @@ [quo2.core :as quo] [quo2.foundations.colors :as colors] [react-native.core :as rn] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [status-im2.contexts.activity-center.notification.common.view :as common] [status-im2.contexts.activity-center.notification.mentions.style :as style] [utils.re-frame :as rf])) diff --git a/src/status_im2/contexts/chat/home/chat_list_item/view.cljs b/src/status_im2/contexts/chat/home/chat_list_item/view.cljs index 63002abcb1..5a269b7273 100644 --- a/src/status_im2/contexts/chat/home/chat_list_item/view.cljs +++ b/src/status_im2/contexts/chat/home/chat_list_item/view.cljs @@ -3,7 +3,7 @@ [quo2.core :as quo] [quo2.foundations.colors :as colors] [react-native.core :as rn] - [status-im.utils.datetime :as time] + [utils.datetime :as datetime] [status-im2.common.home.actions.view :as actions] ;;TODO move to status-im2 [status-im2.contexts.chat.home.chat-list-item.style :as style] [utils.re-frame :as rf])) @@ -99,7 +99,7 @@ [quo/text {:size :label :style (style/timestamp)} - (time/to-short-str timestamp)]]) + (datetime/to-short-str timestamp)]]) (defn avatar-view [group-chat color display-name photo-path chat-id] diff --git a/src/status_im2/contexts/chat/messages/content/view.cljs b/src/status_im2/contexts/chat/messages/content/view.cljs index 645f6f62d5..5ddc030d0d 100644 --- a/src/status_im2/contexts/chat/messages/content/view.cljs +++ b/src/status_im2/contexts/chat/messages/content/view.cljs @@ -12,9 +12,9 @@ [status-im2.contexts.chat.messages.content.system.text.view :as system.text] [quo2.core :as quo] [utils.re-frame :as rf] - [status-im.utils.datetime :as time] [status-im.ui2.screens.chat.messages.message :as old-message] - [status-im2.common.not-implemented :as not-implemented])) + [status-im2.common.not-implemented :as not-implemented] + [utils.datetime :as datetime])) (defn avatar [{:keys [response-to last-in-group? pinned quoted-message from]}] @@ -41,7 +41,7 @@ [quo/author {:profile-name display-name :chat-key from - :time-str (time/timestamp->time timestamp) + :time-str (datetime/timestamp->time timestamp) :contact? added? :verified? ens-verified}]))) diff --git a/src/status_im2/contexts/chat/messages/delete_message/events.cljs b/src/status_im2/contexts/chat/messages/delete_message/events.cljs index 4e7eb7ad37..ca2f667f08 100644 --- a/src/status_im2/contexts/chat/messages/delete_message/events.cljs +++ b/src/status_im2/contexts/chat/messages/delete_message/events.cljs @@ -1,6 +1,6 @@ (ns status-im2.contexts.chat.messages.delete-message.events (:require [status-im.chat.models.message-list :as message-list] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [taoensso.timbre :as log] [utils.re-frame :as rf])) diff --git a/src/status_im2/contexts/chat/messages/delete_message/events_test.cljs b/src/status_im2/contexts/chat/messages/delete_message/events_test.cljs index 999c84825e..bf09320251 100644 --- a/src/status_im2/contexts/chat/messages/delete_message/events_test.cljs +++ b/src/status_im2/contexts/chat/messages/delete_message/events_test.cljs @@ -1,7 +1,7 @@ (ns status-im2.contexts.chat.messages.delete-message.events-test (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.utils.datetime :as datetime] - [status-im2.contexts.chat.messages.delete-message.events :as delete-message])) + [status-im2.contexts.chat.messages.delete-message.events :as delete-message] + [utils.datetime :as datetime])) (def mid "message-id") (def cid "chat-id") diff --git a/src/status_im2/contexts/chat/messages/delete_message_for_me/events.cljs b/src/status_im2/contexts/chat/messages/delete_message_for_me/events.cljs index ad86970f8a..b0aeeaee53 100644 --- a/src/status_im2/contexts/chat/messages/delete_message_for_me/events.cljs +++ b/src/status_im2/contexts/chat/messages/delete_message_for_me/events.cljs @@ -1,6 +1,6 @@ (ns status-im2.contexts.chat.messages.delete-message-for-me.events (:require [status-im.chat.models.message-list :as message-list] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [taoensso.timbre :as log] [utils.re-frame :as rf])) diff --git a/src/status_im2/contexts/chat/messages/delete_message_for_me/events_test.cljs b/src/status_im2/contexts/chat/messages/delete_message_for_me/events_test.cljs index b78800903d..ec6491f23d 100644 --- a/src/status_im2/contexts/chat/messages/delete_message_for_me/events_test.cljs +++ b/src/status_im2/contexts/chat/messages/delete_message_for_me/events_test.cljs @@ -1,7 +1,8 @@ (ns status-im2.contexts.chat.messages.delete-message-for-me.events-test (:require [cljs.test :refer-macros [deftest is testing]] - [status-im.utils.datetime :as datetime] - [status-im2.contexts.chat.messages.delete-message-for-me.events :as delete-message-for-me])) + [utils.datetime :as datetime] + [status-im2.contexts.chat.messages.delete-message-for-me.events :as + delete-message-for-me])) (def mid "message-id") (def cid "chat-id") diff --git a/src/status_im2/contexts/chat/messages/pin/list/view.cljs b/src/status_im2/contexts/chat/messages/pin/list/view.cljs index cba93ae395..c0ed68b248 100644 --- a/src/status_im2/contexts/chat/messages/pin/list/view.cljs +++ b/src/status_im2/contexts/chat/messages/pin/list/view.cljs @@ -5,7 +5,7 @@ [react-native.core :as rn] [status-im2.contexts.chat.messages.content.view :as message] [utils.re-frame :as rf] - [status-im.utils.datetime :as time])) + [utils.datetime :as datetime])) (def list-key-fn #(or (:message-id %) (:value %))) @@ -25,7 +25,7 @@ :message-pin-enabled true :in-pinned-view? true :pinned true - :timestamp-str (time/timestamp->time whisper-timestamp) + :timestamp-str (datetime/timestamp->time whisper-timestamp) :edit-enabled edit-enabled}])) (defn pinned-messages-list diff --git a/src/status_im2/contexts/communities/requests/actions/view.cljs b/src/status_im2/contexts/communities/requests/actions/view.cljs index 652df6b462..e26562eca5 100644 --- a/src/status_im2/contexts/communities/requests/actions/view.cljs +++ b/src/status_im2/contexts/communities/requests/actions/view.cljs @@ -3,7 +3,7 @@ [quo2.core :as quo] [reagent.core :as reagent] [status-im.communities.core :as communities] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im2.contexts.communities.requests.actions.style :as style] [utils.re-frame :as rf] diff --git a/src/status_im2/contexts/quo_preview/buttons/dynamic_button.cljs b/src/status_im2/contexts/quo_preview/buttons/dynamic_button.cljs index 7397b64633..29c6fd9b36 100644 --- a/src/status_im2/contexts/quo_preview/buttons/dynamic_button.cljs +++ b/src/status_im2/contexts/quo_preview/buttons/dynamic_button.cljs @@ -3,7 +3,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im2.contexts.quo-preview.preview :as preview])) (def descriptor diff --git a/src/status_im2/contexts/quo_preview/community/community_card_view.cljs b/src/status_im2/contexts/quo_preview/community/community_card_view.cljs index 35357dad86..9c66fc65b5 100644 --- a/src/status_im2/contexts/quo_preview/community/community_card_view.cljs +++ b/src/status_im2/contexts/quo_preview/community/community_card_view.cljs @@ -4,7 +4,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im2.common.constants :as constants] [status-im2.contexts.quo-preview.preview :as preview])) diff --git a/src/status_im2/contexts/quo_preview/community/data.cljs b/src/status_im2/contexts/quo_preview/community/data.cljs index 36290aa67a..618bc9f555 100644 --- a/src/status_im2/contexts/quo_preview/community/data.cljs +++ b/src/status_im2/contexts/quo_preview/community/data.cljs @@ -1,6 +1,6 @@ (ns status-im2.contexts.quo-preview.community.data (:require [quo.design-system.colors :as quo.colors] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources])) (def thumbnail diff --git a/src/status_im2/contexts/quo_preview/community/discover_card.cljs b/src/status_im2/contexts/quo_preview/community/discover_card.cljs index 6ed7571f4a..3d34988f9a 100644 --- a/src/status_im2/contexts/quo_preview/community/discover_card.cljs +++ b/src/status_im2/contexts/quo_preview/community/discover_card.cljs @@ -4,7 +4,7 @@ [quo2.components.community.discover-card :as discover-card] [quo2.foundations.colors :as colors] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n])) + [i18n.i18n :as i18n])) (def descriptor [{:label "Joined:" diff --git a/src/status_im2/contexts/quo_preview/dividers/new_messages.cljs b/src/status_im2/contexts/quo_preview/dividers/new_messages.cljs index a2e3877164..f5c89950ee 100644 --- a/src/status_im2/contexts/quo_preview/dividers/new_messages.cljs +++ b/src/status_im2/contexts/quo_preview/dividers/new_messages.cljs @@ -3,7 +3,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im2.contexts.quo-preview.preview :as preview])) (def descriptor diff --git a/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs b/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs index b374e5ed29..37a323692d 100644 --- a/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs +++ b/src/status_im2/contexts/quo_preview/list_items/preview_lists.cljs @@ -3,7 +3,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im2.contexts.quo-preview.preview :as preview])) diff --git a/src/status_im2/contexts/quo_preview/messages/gap.cljs b/src/status_im2/contexts/quo_preview/messages/gap.cljs index 411841c41d..8cb1e9365e 100644 --- a/src/status_im2/contexts/quo_preview/messages/gap.cljs +++ b/src/status_im2/contexts/quo_preview/messages/gap.cljs @@ -2,7 +2,7 @@ (:require [quo2.components.messages.gap :as gap] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im2.contexts.quo-preview.preview :as preview])) (def descriptor diff --git a/src/status_im2/contexts/quo_preview/messages/system_message.cljs b/src/status_im2/contexts/quo_preview/messages/system_message.cljs index 99eba80113..14473afcd8 100644 --- a/src/status_im2/contexts/quo_preview/messages/system_message.cljs +++ b/src/status_im2/contexts/quo_preview/messages/system_message.cljs @@ -3,7 +3,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.react-native.resources :as resources] [status-im2.contexts.quo-preview.preview :as preview])) diff --git a/src/status_im2/contexts/quo_preview/navigation/floating_shell_button.cljs b/src/status_im2/contexts/quo_preview/navigation/floating_shell_button.cljs index adab35db0b..4121d3a056 100644 --- a/src/status_im2/contexts/quo_preview/navigation/floating_shell_button.cljs +++ b/src/status_im2/contexts/quo_preview/navigation/floating_shell_button.cljs @@ -4,7 +4,7 @@ [react-native.core :as rn] [react-native.reanimated :as reanimated] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im2.contexts.quo-preview.preview :as preview])) (def descriptor diff --git a/src/status_im2/contexts/quo_preview/tags/status_tags.cljs b/src/status_im2/contexts/quo_preview/tags/status_tags.cljs index 509e15ee87..17690e0f03 100644 --- a/src/status_im2/contexts/quo_preview/tags/status_tags.cljs +++ b/src/status_im2/contexts/quo_preview/tags/status_tags.cljs @@ -3,7 +3,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im2.contexts.quo-preview.preview :as preview])) (def status-tags-options diff --git a/src/status_im2/contexts/quo_preview/wallet/network_amount.cljs b/src/status_im2/contexts/quo_preview/wallet/network_amount.cljs index 9d6233e746..aa23429d49 100644 --- a/src/status_im2/contexts/quo_preview/wallet/network_amount.cljs +++ b/src/status_im2/contexts/quo_preview/wallet/network_amount.cljs @@ -4,7 +4,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im2.contexts.quo-preview.preview :as preview])) (def ^:private networks diff --git a/src/status_im2/contexts/quo_preview/wallet/network_breakdown.cljs b/src/status_im2/contexts/quo_preview/wallet/network_breakdown.cljs index 93c83d24bf..1d97b0e2e9 100644 --- a/src/status_im2/contexts/quo_preview/wallet/network_breakdown.cljs +++ b/src/status_im2/contexts/quo_preview/wallet/network_breakdown.cljs @@ -4,7 +4,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im2.contexts.quo-preview.preview :as preview])) (def descriptor diff --git a/src/status_im2/contexts/quo_preview/wallet/token_overview.cljs b/src/status_im2/contexts/quo_preview/wallet/token_overview.cljs index 338b8db9a8..f57a83cb65 100644 --- a/src/status_im2/contexts/quo_preview/wallet/token_overview.cljs +++ b/src/status_im2/contexts/quo_preview/wallet/token_overview.cljs @@ -3,7 +3,7 @@ [quo2.foundations.colors :as colors] [react-native.core :as rn] [reagent.core :as reagent] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.utils.currency :as currencies] [status-im2.contexts.quo-preview.preview :as preview])) diff --git a/src/status_im2/setup/core.cljs b/src/status_im2/setup/core.cljs index f7190c02e1..0b2d89c31f 100644 --- a/src/status_im2/setup/core.cljs +++ b/src/status_im2/setup/core.cljs @@ -20,6 +20,7 @@ [status-im2.setup.config :as config] [status-im2.setup.dev :as dev] status-im2.setup.events + status-im2.setup.datetime [status-im2.setup.global-error :as global-error] [status-im2.setup.i18n-resources :as i18n-resources] [status-im2.setup.log :as log] @@ -31,17 +32,19 @@ (defn init [] + (log/setup config/log-level) (global-error/register-handler) (when platform/android? (status/set-soft-input-mode status/adjust-resize)) (notifications/listen-notifications) (.addEventListener rn/app-state "change" #(re-frame/dispatch [:app-state-change %])) - (i18n/init (name i18n-resources/default-device-language) - (clj->js i18n-resources/translations-by-locale)) - (react-native-languages/add-change-listener #(fn [lang] - (i18n/set-language lang) - (i18n-resources/load-language lang))) + (i18n/init) + + (react-native-languages/add-change-listener + #(fn [lang] + (i18n/load-language lang i18n-resources/loaded-languages) + (i18n/set-language lang))) (react-native-shake/add-shake-listener #(re-frame/dispatch [:shake-event])) (utils.universal-links/initialize) diff --git a/src/status_im2/setup/datetime.cljs b/src/status_im2/setup/datetime.cljs new file mode 100644 index 0000000000..2f106163a0 --- /dev/null +++ b/src/status_im2/setup/datetime.cljs @@ -0,0 +1,8 @@ +(ns status-im2.setup.datetime + (:require [re-frame.core :as re-frame] + [utils.datetime :as datetime])) + +(re-frame/reg-cofx + :now + (fn [coeffects _] + (assoc coeffects :now (datetime/timestamp)))) \ No newline at end of file diff --git a/src/status_im2/setup/i18n_resources.cljs b/src/status_im2/setup/i18n_resources.cljs index 73ef69b208..eb75414db9 100644 --- a/src/status_im2/setup/i18n_resources.cljs +++ b/src/status_im2/setup/i18n_resources.cljs @@ -1,76 +1,6 @@ (ns status-im2.setup.i18n-resources - (:require [clojure.string :as string] - [i18n.i18n :as i18n] - [react-native.languages :as react-native-languages])) - -(def default-device-language (react-native-languages/get-lang-keyword)) - -(def languages - #{:ar :bn :de :el :en :es :es_419 :es_AR :fil :fr :hi :id :in :it :ja :ko :ms :nl :pl :pt :pt_BR :ru - :tr :vi :zh :zh_Hant :zh_TW}) + (:require [i18n.i18n :as i18n])) (defonce loaded-languages (atom - (conj #{:en} default-device-language))) - -(defn valid-language - [lang] - (if (contains? languages lang) - (keyword lang) - (let [parts (string/split (name lang) #"[\-\_]") - short-lang (keyword (str (first parts) "_" (second parts))) - shortest-lang (keyword (first parts))] - (if (and (> (count parts) 2) (contains? languages short-lang)) - short-lang - (when (contains? languages shortest-lang) - shortest-lang))))) - -(defn require-translation - [lang-key] - (when-let [lang (valid-language (keyword lang-key))] - (case lang - :ar (js/require "../translations/ar.json") - :bn (js/require "../translations/bn.json") - :de (js/require "../translations/de.json") - :el (js/require "../translations/el.json") - :en (js/require "../translations/en.json") - :es (js/require "../translations/es.json") - :es_419 (js/require "../translations/es_419.json") - :es_AR (js/require "../translations/es_AR.json") - :fil (js/require "../translations/fil.json") - :fr (js/require "../translations/fr.json") - :hi (js/require "../translations/hi.json") - :id (js/require "../translations/id.json") - :in (js/require "../translations/id.json") - :it (js/require "../translations/it.json") - :ja (js/require "../translations/ja.json") - :ko (js/require "../translations/ko.json") - :ms (js/require "../translations/ms.json") - :nl (js/require "../translations/nl.json") - :pl (js/require "../translations/pl.json") - :pt (js/require "../translations/pt.json") - :pt_BR (js/require "../translations/pt_BR.json") - :ru (js/require "../translations/ru.json") - :tr (js/require "../translations/tr.json") - :vi (js/require "../translations/vi.json") - :zh (js/require "../translations/zh.json") - :zh_Hant (js/require "../translations/zh_hant.json") - :zh_TW (js/require "../translations/zh_TW.json")))) - -;; translations -(def translations-by-locale - (cond-> {:en (require-translation :en)} - (not= :en default-device-language) - (assoc default-device-language - (require-translation (-> (name default-device-language) - (string/replace "-" "_") - keyword))))) - -(defn load-language - [lang] - (when-let [lang-key (valid-language (keyword lang))] - (when-not (contains? @loaded-languages lang-key) - (aset (i18n/get-translations) - lang - (require-translation lang-key)) - (swap! loaded-languages conj lang-key)))) + (conj #{:en} i18n/default-device-language))) diff --git a/src/status_im2/setup/i18n_test.cljs b/src/status_im2/setup/i18n_test.cljs index 3671c02660..298d6fd63f 100644 --- a/src/status_im2/setup/i18n_test.cljs +++ b/src/status_im2/setup/i18n_test.cljs @@ -3,12 +3,11 @@ [cljs.test :refer-macros [deftest is]] [clojure.set :as set] [clojure.string :as string] - [i18n.i18n :as i18n] - [status-im2.setup.i18n-resources :as i18n-resources])) + [i18n.i18n :as i18n])) ;; english as source of truth (def labels - (set (keys (js->clj (:en i18n-resources/translations-by-locale) + (set (keys (js->clj (:en i18n/translations-by-locale) :keywordize-keys true)))) @@ -17,7 +16,7 @@ (defn labels-for-all-locales [] - (->> i18n-resources/translations-by-locale + (->> i18n/translations-by-locale (mapcat #(-> % val (js->clj :keywordize-keys true) keys)) set)) @@ -1025,14 +1024,14 @@ ;; locales -(def locales (set (keys i18n-resources/translations-by-locale))) +(def locales (set (keys i18n/translations-by-locale))) (spec/def ::locale locales) (spec/def ::locales (spec/coll-of ::locale :kind set? :into #{})) (defn locale->labels [locale] - (-> i18n-resources/translations-by-locale (get locale) (js->clj :keywordize-keys true) keys set)) + (-> i18n/translations-by-locale (get locale) (js->clj :keywordize-keys true) keys set)) (defn locale->checkpoint [locale] diff --git a/src/status_im2/subs/chat/chats.cljs b/src/status_im2/subs/chat/chats.cljs index 2cad2fbfbf..70ec768768 100644 --- a/src/status_im2/subs/chat/chats.cljs +++ b/src/status_im2/subs/chat/chats.cljs @@ -8,7 +8,7 @@ [status-im.communities.core :as communities] [status-im.group-chats.core :as group-chat] [status-im.group-chats.db :as group-chats.db] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.multiaccounts.core :as multiaccounts] [status-im.utils.config :as config] [status-im.utils.image-server :as image-server] diff --git a/src/status_im2/subs/chat/messages.cljs b/src/status_im2/subs/chat/messages.cljs index 68b69bb74c..37bdee5fc0 100644 --- a/src/status_im2/subs/chat/messages.cljs +++ b/src/status_im2/subs/chat/messages.cljs @@ -3,7 +3,7 @@ [status-im.chat.db :as chat.db] [status-im.chat.models.message-list :as models.message-list] [status-im.chat.models.reactions :as models.reactions] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [status-im2.common.constants :as constants])) (re-frame/reg-sub diff --git a/src/status_im2/subs/keycard.cljs b/src/status_im2/subs/keycard.cljs index 45df429b68..561b37c8b9 100644 --- a/src/status_im2/subs/keycard.cljs +++ b/src/status_im2/subs/keycard.cljs @@ -3,7 +3,7 @@ [re-frame.core :as re-frame] [status-im.ethereum.core :as ethereum] [status-im.keycard.common :as common] - [status-im.utils.datetime :as utils.datetime])) + [utils.datetime :as datetime])) (re-frame/reg-sub :keycard/nfc-enabled? @@ -122,7 +122,7 @@ :keycard-paired-on (fn [db] (some-> (get-in db [:multiaccount :keycard-paired-on]) - (utils.datetime/timestamp->year-month-day-date)))) + (datetime/timestamp->year-month-day-date)))) (re-frame/reg-sub :keycard-multiaccount-pairing diff --git a/src/status_im2/subs/wallet/signing.cljs b/src/status_im2/subs/wallet/signing.cljs index e440c8c865..08b2bffdd3 100644 --- a/src/status_im2/subs/wallet/signing.cljs +++ b/src/status_im2/subs/wallet/signing.cljs @@ -3,7 +3,7 @@ [re-frame.core :as re-frame] [status-im.ethereum.core :as ethereum] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.signing.gas :as signing.gas] [status-im.utils.money :as money] [status-im.wallet.db :as wallet.db])) diff --git a/src/status_im2/subs/wallet/transactions.cljs b/src/status_im2/subs/wallet/transactions.cljs index 45b981729b..0f5be4124d 100644 --- a/src/status_im2/subs/wallet/transactions.cljs +++ b/src/status_im2/subs/wallet/transactions.cljs @@ -1,9 +1,9 @@ (ns status-im2.subs.wallet.transactions (:require [re-frame.core :as re-frame] [status-im.ethereum.transactions.core :as transactions] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.notifications.core :as notifications] - [status-im.utils.datetime :as datetime] + [utils.datetime :as datetime] [status-im.utils.money :as money] [status-im.wallet.db :as wallet.db] [status-im.wallet.utils :as wallet.utils])) diff --git a/src/status_im2/subs/wallet/wallet.cljs b/src/status_im2/subs/wallet/wallet.cljs index 26a24bef31..74952c029a 100644 --- a/src/status_im2/subs/wallet/wallet.cljs +++ b/src/status_im2/subs/wallet/wallet.cljs @@ -3,7 +3,7 @@ [re-frame.core :as re-frame] [status-im.ethereum.core :as ethereum] [status-im.ethereum.tokens :as tokens] - [status-im.i18n.i18n :as i18n] + [i18n.i18n :as i18n] [status-im.utils.config :as config] [status-im.utils.currency :as currency] [status-im.utils.money :as money])) diff --git a/src/status_im/utils/datetime.cljs b/src/utils/datetime.cljs similarity index 97% rename from src/status_im/utils/datetime.cljs rename to src/utils/datetime.cljs index b41aa8b0fc..58c9f8c89c 100644 --- a/src/status_im/utils/datetime.cljs +++ b/src/utils/datetime.cljs @@ -1,10 +1,9 @@ -(ns status-im.utils.datetime +(ns utils.datetime (:require [cljs-time.coerce :as t.coerce] [cljs-time.core :as t] [cljs-time.format :as t.format] [clojure.string :as string] [i18n.i18n :as i18n] - [re-frame.core :as re-frame] [status-im.goog.i18n :as goog.18n] [status-im.native-module.core :as status])) @@ -248,11 +247,6 @@ [ms] (t.format/unparse (:year-month-day t.format/formatters) (to-date ms))) -(re-frame/reg-cofx - :now - (fn [coeffects _] - (assoc coeffects :now (timestamp)))) - (defn to-ms [sec] (* 1000 sec)) diff --git a/src/utils/datetime_test.cljs b/src/utils/datetime_test.cljs new file mode 100644 index 0000000000..baf2a57a8b --- /dev/null +++ b/src/utils/datetime_test.cljs @@ -0,0 +1,191 @@ +(ns utils.datetime-test + (:require [cljs-time.coerce :as time-coerce] + [cljs-time.core :as t] + [cljs.test :refer-macros [deftest testing is]] + [status-im.goog.i18n :as i18n] + status-im2.setup.datetime + [utils.datetime :as datetime])) + +(defn match + [name symbols] + (is (identical? (.-dateTimeSymbols_ (i18n/mk-fmt name #'utils.datetime/medium-date-format)) + symbols))) + +(deftest date-time-formatter-test + (match "en-US" goog.i18n.DateTimeSymbols_en_US) + (match "en-ZZ" goog.i18n.DateTimeSymbols_en) + (match "en" goog.i18n.DateTimeSymbols_en) + (match "nb-NO" goog.i18n.DateTimeSymbols_nb) + (match "nb" goog.i18n.DateTimeSymbols_nb) + (match "whoa-WHOA" goog.i18n.DateTimeSymbols_en) + (match "whoa" goog.i18n.DateTimeSymbols_en)) + +;; 1970-01-01 00:00:00 UTC +(def epoch 0) +;; 1970-01-03 00:00:00 UTC +(def epoch-plus-3d 172800000) + +(deftest is-24-hour-locale-en-test + (is (= (#'utils.datetime/is-24-hour-locsym (i18n/locale-symbols "en")) false))) + +(deftest is-24-hour-locale-it-test + (is (= (#'utils.datetime/is-24-hour-locsym (i18n/locale-symbols "it")) true))) + +(deftest is-24-hour-locale-nb-test + (is (= (#'utils.datetime/is-24-hour-locsym (i18n/locale-symbols "nb-NO")) true))) + +(deftest to-short-str-today-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/time-fmt (fn [] + (i18n/mk-fmt "us" #'utils.datetime/short-time-format)) + datetime/time-zone-offset (t/period :hours 0)] + (is (= (datetime/to-short-str epoch-plus-3d) "12:00 AM")))) + +#_((deftest to-short-str-today-force-24H-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/is-24-hour (constantly true) + datetime/time-fmt (i18n-module/mk-fmt "us" datetime/short-time-format) + datetime/time-zone-offset (t/period :hours 0)] + (is (= (datetime/to-short-str epoch-plus-3d) "00:00")))) + + (deftest to-short-str-today-force-AMPM-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/is-24-hour (constantly false) + datetime/time-fmt (i18n-module/mk-fmt "it" datetime/short-time-format) + datetime/time-zone-offset (t/period :hours 0)] + (is (= (datetime/to-short-str epoch-plus-3d) "12:00 AM"))))) + +(deftest to-short-str-before-yesterday-us-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/time-zone-offset (t/period :hours 0) + datetime/date-fmt (fn [] + (i18n/mk-fmt "us" #'utils.datetime/medium-date-format))] + (is (= (datetime/to-short-str epoch) "Jan 1, 1970")))) + +(deftest to-short-str-before-yesterday-nb-test + (with-redefs [datetime/time-zone-offset (t/period :hours 0) + datetime/date-fmt (fn [] + (i18n/mk-fmt "nb-NO" #'utils.datetime/medium-date-format)) + t/*ms-fn* (constantly epoch-plus-3d)] + (is (= (datetime/to-short-str epoch) "1. jan. 1970")))) + +(deftest day-relative-before-yesterday-us-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/time-zone-offset (t/period :hours 0) + datetime/date-fmt (fn [] + (i18n/mk-fmt "us" + #'utils.datetime/medium-date-time-format))] + (is (= (datetime/day-relative epoch) "Jan 1, 1970, 12:00:00 AM")))) + +(deftest day-relative-before-yesterday-nb-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/time-zone-offset (t/period :hours 0) + datetime/date-fmt (fn [] + (i18n/mk-fmt "nb-NO" + #'utils.datetime/medium-date-time-format))] + (is (= (datetime/day-relative epoch) "1. jan. 1970, 00:00:00")))) + +(deftest current-year?-test + ;; Today is Monday, 1975-03-10 15:15:45Z + (with-redefs [t/*ms-fn* (constantly 163696545000) + datetime/time-zone-offset (t/period :hours 0)] + (is (datetime/current-year? (t/now))) + + (testing "returns false for future years" + (is (not (datetime/current-year? (t/plus (t/now) (t/years 1)))))) + + (testing "returns true at 1975-01-01 00:00:00" + (is (datetime/current-year? (time-coerce/from-long 157766400000)))) + + (testing "returns false at 1974-12-31 23:59:59" + (is (not (datetime/current-year? (time-coerce/from-long 157766399000))))))) + +(deftest previous-years?-test + ;; Today is Monday, 1975-03-10 15:15:45Z + (with-redefs [t/*ms-fn* (constantly 163696545000) + datetime/time-zone-offset (t/period :hours 0)] + (is (not (datetime/previous-years? (t/now)))) + + (testing "returns false for future years" + (is (not (datetime/current-year? (t/plus (t/now) (t/years 1)))))) + + (testing "returns false at 1975-01-01 00:00:00" + (is (not (datetime/previous-years? (time-coerce/from-long 1640995200000))))) + + (testing "returns true at 1974-12-31 23:59:59" + (is (not (datetime/previous-years? (time-coerce/from-long 1640995199000))))))) + +(deftest within-last-n-days?-test + ;; Today is Monday, 1975-03-10 15:15:45Z + (let [now 163696545000] + (with-redefs [t/*ms-fn* (constantly now) + datetime/time-zone-offset (t/period :hours 0)] + (testing "start of the period, 6 days ago (inclusive)" + ;; Tuesday, 1975-03-03 23:59:59Z + (is (not (datetime/within-last-n-days? (time-coerce/from-long 163123199000) 6))) + + ;; Tuesday, 1975-03-04 00:00:00Z + (is (datetime/within-last-n-days? (time-coerce/from-long 163123200000) 6)) + + ;; Tuesday, 1975-03-04 00:00:01Z + (is (datetime/within-last-n-days? (time-coerce/from-long 163123201000) 6))) + + (testing "end of the period (inclusive)" + ;; Monday, 1975-03-10 15:15:44Z + (is (datetime/within-last-n-days? (time-coerce/from-long 163696544000) 6)) + + ;; Monday, 1975-03-10 15:15:45Z + (is (datetime/within-last-n-days? (time-coerce/from-long now) 6)) + + ;; Monday, 1975-03-10 15:15:46Z + (is (not (datetime/within-last-n-days? (time-coerce/from-long 163696546000) 6))))))) + +(deftest timestamp->relative-test + ;; Today is Monday, 1975-03-10 15:15:45Z + (with-redefs [t/*ms-fn* (constantly 163696545000) + datetime/time-zone-offset (t/period :hours 0) + datetime/is-24-hour (constantly false)] + (testing "formats previous years" + ;; 1974-12-31 23:59:59Z + (is (= "Dec 31, 1974" (datetime/timestamp->relative 157766399000))) + ;; 1973-01-01 00:00:00Z + (is (= "Jan 1, 1973" (datetime/timestamp->relative 94694400000)))) + + (testing "formats 7 days ago or older, but in the current year" + (is (= "03 Mar" (datetime/timestamp->relative 163091745000))) + (is (= "02 Mar" (datetime/timestamp->relative 163004400000))) + (is (= "01 Jan" (datetime/timestamp->relative 157820400000)))) + + (testing "formats dates within the last 6 days" + (is (= "Sat 3:15 PM" (datetime/timestamp->relative 163523745000))) + (is (= "Fri 3:15 PM" (datetime/timestamp->relative 163437345000))) + (is (= "Thu 3:15 PM" (datetime/timestamp->relative 163350945000))) + (is (= "Wed 3:15 PM" (datetime/timestamp->relative 163264545000))) + (is (= "Tue 3:15 PM" (datetime/timestamp->relative 163178145000)))) + + (testing "formats within yesterday window" + (is (= "Yesterday 3:15 PM" (datetime/timestamp->relative 163610145000))) + (is (= "Yesterday 11:59 PM" (datetime/timestamp->relative 163641599000)))) + + (testing "formats today, at various timestamps" + (is (= "3:15 PM" (datetime/timestamp->relative 163696545000))) + (is (= "12:00 PM" (datetime/timestamp->relative 163684800000))) + (is (= "12:00 AM" (datetime/timestamp->relative 163641600000)))))) + +#_((deftest day-relative-before-yesterday-force-24H-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/is-24-hour (constantly true) + datetime/time-zone-offset (t/period :hours 0) + datetime/date-fmt (i18n-module/mk-fmt + "us" + #'utils.datetime/medium-date-time-format)] + (is (= (datetime/day-relative epoch) "Jan 1, 1970, 00:00:00")))) + + (deftest day-relative-before-yesterday-force-AMPM-test + (with-redefs [t/*ms-fn* (constantly epoch-plus-3d) + datetime/is-24-hour (constantly false) + datetime/time-zone-offset (t/period :hours 0) + datetime/date-fmt (i18n-module/mk-fmt + "it" + #'utils.datetime/medium-date-time-format)] + (is (= (datetime/day-relative epoch) "01 gen 1970, 12:00:00 AM"))))) diff --git a/src/utils/requests.cljs b/src/utils/requests.cljs index 97f99bc6d7..0eb28f5f8f 100644 --- a/src/utils/requests.cljs +++ b/src/utils/requests.cljs @@ -1,5 +1,5 @@ (ns utils.requests - (:require [status-im.utils.datetime :as datetime])) + (:require [utils.datetime :as datetime])) (def request-cooldown-ms (* 24 60 60 1000))