Adds locale to new strings

This commit is contained in:
alonso.torres 2020-10-15 16:19:36 +02:00
parent 929d620c60
commit f8abcc1b9c
6 changed files with 137 additions and 124 deletions

View file

@ -10,6 +10,7 @@
(ns app.main.ui.components.color-bullet
(:require
[rumext.alpha :as mf]
[app.util.i18n :as i18n :refer [tr]]
[app.util.color :as uc]))
(mf/defc color-bullet [{:keys [color on-click]}]
@ -24,16 +25,16 @@
[:div.color-bullet-right {:style {:background (uc/color->background color)}}]])))
(defn gradient-type->string [{:keys [type]}]
(defn gradient-type->string [type]
(case type
:linear "Linear"
:radial "Radial"))
:linear (tr "workspace.gradients.linear")
:radial (tr "workspace.gradients.radial")
(str "???" type)))
(mf/defc color-name [{:keys [color size on-click on-double-click]}]
(let [color (if (string? color) {:color color :opacity 1} color)
{:keys [name color opacity gradient]} color
color-str (or name color (gradient-type->string gradient))]
#_(when (= size :big) [:span.color-text {:title (:name color) } (or (:name color) (:value color))])
color-str (or name color (gradient-type->string (:type gradient)))]
(when (= size :big)
[:span.color-text {:on-click #(when on-click (on-click %))
:on-double-click #(when on-double-click (on-double-click %))