🎉 Add new translations management script

This commit is contained in:
Andrey Antukh 2024-06-13 11:45:01 +02:00 committed by AzazelN28
parent 62cea62356
commit 139dd7d80f
22 changed files with 677 additions and 308 deletions

View file

@ -12,7 +12,6 @@
[app.config :as cfg]
[app.util.dom :as dom]
[app.util.globals :as globals]
[app.util.object :as obj]
[app.util.storage :refer [storage]]
[cuerdas.core :as str]
[goog.object :as gobj]
@ -173,15 +172,11 @@
([code] (t @locale code))
([code & args] (apply t @locale code args)))
(mf/defc tr-html
{::mf/wrap-props false}
[props]
(let [label (obj/get props "label")
class (obj/get props "class")
tag-name (obj/get props "tag-name" "p")
params (obj/get props "params" [])
html (apply tr (d/concat-vec [label] params))]
[:> tag-name {:dangerouslySetInnerHTML #js {:__html html}
(mf/defc tr-html*
{::mf/props :obj}
[{:keys [content class tag-name]}]
(let [tag-name (d/nilv tag-name "p")]
[:> tag-name {:dangerouslySetInnerHTML #js {:__html content}
:className class}]))
;; DEPRECATED