0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 16:00:19 -05:00

💄 Minor cosmetic changes on message collection (i18n).

This commit is contained in:
Andrey Antukh 2020-01-21 21:31:43 +01:00
parent 24677a3266
commit 1724f55cb2
2 changed files with 10 additions and 11 deletions

View file

@ -18,23 +18,22 @@
(defn- find-translations-in-form (defn- find-translations-in-form
[form] [form]
(let [messages (atom [])] (reduce (fn [messages node]
(run! (fn [node]
(let [found (->> node (let [found (->> node
(filter #(and (seq? %) (= :string (first %)))) (filter #(and (seq? %) (= :string (first %))))
(map (fn [item] (map (fn [item]
(let [mdata (meta item)] (let [mdata (meta item)]
{:code (edn/read-string (second item)) {:code (edn/read-string (second item))
:line (get-in mdata [::pa/start :row])}))))] :line (get-in mdata [::pa/start :row])}))))]
(swap! messages into found))) (into messages found)))
[]
(->> (tree-seq seq? seq form) (->> (tree-seq seq? seq form)
(filter #(and (seq? %) (filter #(and (seq? %)
(seq? (second %)) (seq? (second %))
(= :list (first %)) (= :list (first %))
(= :symbol (first (second %))) (= :symbol (first (second %)))
(or (= "t" (second (second %))) (or (= "t" (second (second %)))
(= "tr" (second (second %)))))))) (= "tr" (second (second %)))))))))
@messages))
(defn- find-translations (defn- find-translations
[path] [path]

View file

@ -197,11 +197,11 @@
} }
}, },
"ds.num-elements" : { "ds.num-elements" : {
"used-in" : [ "src/uxbox/main/ui/dashboard/colors.cljs:111" ],
"translations" : { "translations" : {
"en" : null, "en" : null,
"fr" : null "fr" : null
}, }
"used-in" : [ "src/uxbox/main/ui/dashboard/colors.cljs:111" ]
}, },
"ds.position" : { "ds.position" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/icon_measures.cljs:52" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/icon_measures.cljs:52" ],
@ -239,11 +239,11 @@
} }
}, },
"ds.settings.icons" : { "ds.settings.icons" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/icons.cljs:72" ],
"translations" : { "translations" : {
"en" : null, "en" : null,
"fr" : null "fr" : null
}, }
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/icons.cljs:72" ]
}, },
"ds.size" : { "ds.size" : {
"used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/icon_measures.cljs:33" ], "used-in" : [ "src/uxbox/main/ui/workspace/sidebar/options/icon_measures.cljs:33" ],
@ -582,11 +582,11 @@
} }
}, },
"settings.exit" : { "settings.exit" : {
"used-in" : [ "src/uxbox/main/ui/settings/header.cljs:46" ],
"translations" : { "translations" : {
"en" : null, "en" : null,
"fr" : null "fr" : null
}, }
"used-in" : [ "src/uxbox/main/ui/settings/header.cljs:46" ]
}, },
"settings.notifications" : { "settings.notifications" : {
"used-in" : [ "src/uxbox/main/ui/settings/header.cljs:43" ], "used-in" : [ "src/uxbox/main/ui/settings/header.cljs:43" ],