mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 11:28:25 +02:00
💄 Minor cosmetic changes on message collection (i18n).
This commit is contained in:
parent
24677a3266
commit
1724f55cb2
2 changed files with 10 additions and 11 deletions
|
@ -18,23 +18,22 @@
|
|||
|
||||
(defn- find-translations-in-form
|
||||
[form]
|
||||
(let [messages (atom [])]
|
||||
(run! (fn [node]
|
||||
(reduce (fn [messages node]
|
||||
(let [found (->> node
|
||||
(filter #(and (seq? %) (= :string (first %))))
|
||||
(map (fn [item]
|
||||
(let [mdata (meta item)]
|
||||
{:code (edn/read-string (second item))
|
||||
:line (get-in mdata [::pa/start :row])}))))]
|
||||
(swap! messages into found)))
|
||||
(into messages found)))
|
||||
[]
|
||||
(->> (tree-seq seq? seq form)
|
||||
(filter #(and (seq? %)
|
||||
(seq? (second %))
|
||||
(= :list (first %))
|
||||
(= :symbol (first (second %)))
|
||||
(or (= "t" (second (second %)))
|
||||
(= "tr" (second (second %))))))))
|
||||
@messages))
|
||||
(= "tr" (second (second %)))))))))
|
||||
|
||||
(defn- find-translations
|
||||
[path]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue