Merge branch 'i18n/main' of github.com:Monogramm/uxbox into i18n/main

This commit is contained in:
mathieu.brunot 2019-09-12 16:49:07 +02:00
commit 0e8da8e39b
No known key found for this signature in database
GPG key ID: C438ED0898C9E020
15 changed files with 170 additions and 71 deletions

View file

@ -134,7 +134,7 @@
{:style {:background-image (str "url('" @url "')")}}]
[:div.grid-item-th
[:img.img-th {:src "/images/project-placeholder.svg"
:alt "Project title"}]])))
:alt (tr "ds.project-thumbnail.alt")}]])))
@ -172,7 +172,7 @@
:default-value (:name project)}]
[:h3 (:name project)])
[:span.date
(str "Updated " (dt/timeago (:modified-at project)))]]
(str (tr "ds.updated-at" (dt/timeago (:modified-at project))))]]
[:div.project-th-actions
[:div.project-th-icon.pages
i/page

View file

@ -93,16 +93,16 @@
(assoc-value :height (:width data))))]
[:form {:on-submit on-submit}
[:input#project-name.input-text
{:placeholder "New project name"
{:placeholder (tr "ds.project.placeholder")
:type "text"
:value (:name data)
:auto-focus true
:on-change update-name}]
[:div.project-size
[:div.input-element.pixels
[:span "Width"]
[:span (tr "ds.width")]
[:input#project-witdh.input-text
{:placeholder "Width"
{:placeholder (tr "ds.width")
:type "number"
:min 0 ;;TODO check this value
:max 666666 ;;TODO check this value
@ -110,9 +110,9 @@
:on-change (partial update-size :width)}]]
[:a.toggle-layout {:on-click swap-size} i/toggle]
[:div.input-element.pixels
[:span "Height"]
[:span (tr "ds.height")]
[:input#project-height.input-text
{:placeholder "Height"
{:placeholder (tr "ds.height")
:type "number"
:min 0 ;;TODO check this value
:max 666666 ;;TODO check this value
@ -124,7 +124,7 @@
;; Submit
[:input#project-btn.btn-primary
{:value "Go go go!"
{:value (tr "ds.go")
:class (when-not valid? "btn-disabled")
:disabled (not valid?)
:type "submit"}]]))))
@ -140,7 +140,7 @@
:render
(fn [own]
[:div.lightbox-body
[:h3 "New project"]
[:h3 (tr "ds.project.new")]
(create-project-form)
[:a.close {:on-click #(st/emit! (udl/close-lightbox))}
i/close]]))

View file

@ -22,6 +22,7 @@
[uxbox.main.ui.users :refer [user]]
[uxbox.main.ui.workspace.clipboard]
[uxbox.util.data :refer [index-of]]
[uxbox.util.i18n :refer (tr)]
[uxbox.util.geom.point :as gpt]
[uxbox.util.math :as mth]
[uxbox.util.router :as rt]))
@ -54,7 +55,7 @@
[:div.main-icon
[:a {:on-click #(st/emit! (rt/nav :dashboard/projects))} i/logo-icon]]
[:div.project-tree-btn
{:alt "Sitemap (Ctrl + Shift + M)"
{:alt (tr "header.sitemap")
:class (when (contains? flags :sitemap) "selected")
:on-click (partial toggle :sitemap)}
i/project-tree
@ -62,76 +63,76 @@
[:div.workspace-options
[:ul.options-btn
[:li.tooltip.tooltip-bottom
{:alt "Draw tools (Ctrl + Shift + S)"
{:alt (tr "header.draw-tools")
:class (when (contains? flags :drawtools) "selected")
:on-click (partial toggle :drawtools)}
i/shapes]
[:li.tooltip.tooltip-bottom
{:alt "Color Palette (---)"
{:alt (tr "header.color-palette")
:class (when (contains? flags :colorpalette) "selected")
:on-click (partial toggle :colorpalette)}
i/palette]
[:li.tooltip.tooltip-bottom
{:alt "Icons (Ctrl + Shift + I)"
{:alt (tr "header.icons")
:class (when (contains? flags :icons) "selected")
:on-click (partial toggle :icons)}
i/icon-set]
[:li.tooltip.tooltip-bottom
{:alt "Layers (Ctrl + Shift + L)"
{:alt (tr "header.layers")
:class (when (contains? flags :layers) "selected")
:on-click (partial toggle :layers)}
i/layers]
[:li.tooltip.tooltip-bottom
{:alt "Element options (Ctrl + Shift + O)"
{:alt (tr "header.element-options")
:class (when (contains? flags :element-options) "selected")
:on-click (partial toggle :element-options)}
i/options]
[:li.tooltip.tooltip-bottom
{:alt "History (Ctrl + Shift + H)"
{:alt (tr "header.document-history")
:class (when (contains? flags :document-history) "selected")
:on-click (partial toggle :document-history)}
i/undo-history]]
[:ul.options-btn
[:li.tooltip.tooltip-bottom
{:alt "Undo (Ctrl + Z)"
{:alt (tr "header.undo")
:on-click on-undo}
i/undo]
[:li.tooltip.tooltip-bottom
{:alt "Redo (Ctrl + Shift + Z)"
{:alt (tr "header.redo")
:on-click on-redo}
i/redo]]
[:ul.options-btn
[:li.tooltip.tooltip-bottom
{:alt "Download (Ctrl + E)"
{:alt (tr "header.download")
;; :on-click on-download
}
i/download]
[:li.tooltip.tooltip-bottom
{:alt "Image (Ctrl + I)"
{:alt (tr "header.image")
:on-click on-image}
i/image]]
[:ul.options-btn
[:li.tooltip.tooltip-bottom
{:alt "Rules"
{:alt (tr "header.rules")
:class (when (contains? flags :rules) "selected")
:on-click (partial toggle :rules)}
i/ruler]
[:li.tooltip.tooltip-bottom
{:alt "Grid (Ctrl + G)"
{:alt (tr "header.grid")
:class (when (contains? flags :grid) "selected")
:on-click (partial toggle :grid)}
i/grid]
[:li.tooltip.tooltip-bottom
{:alt "Snap to grid"
{:alt (tr "header.grid-snap")
:class (when (contains? flags :grid-snap) "selected")
:on-click (partial toggle :grid-snap)}
i/grid-snap]]
;; [:li.tooltip.tooltip-bottom
;; {:alt "Align (Ctrl + A)"}
;; {:alt (tr "header.align")}
;; i/alignment]]
[:ul.options-btn
[:li.tooltip.tooltip-bottom.view-mode
{:alt "View mode (Ctrl + P)"
{:alt (tr "header.view-mode")
:on-click #(st/emit! (dw/->OpenView (:id page)))
}
i/play]]

View file

@ -93,7 +93,7 @@
[:div#form-tools.tool-window.drawing-tools
[:div.tool-window-bar
[:div.tool-window-icon i/window]
[:span (tr "ds.draw-tools")]
[:span (tr "ds.settings.draw-tools")]
[:div.tool-window-close {:on-click close} i/close]]
[:div.tool-window-content
(for [[i props] (map-indexed vector tools)]

View file

@ -14,7 +14,7 @@
[uxbox.main.data.workspace :as dw]
[uxbox.util.data :refer [read-string]]
[uxbox.util.dom :as dom]
[uxbox.util.i18n :refer [tr]]
[uxbox.util.i18n :refer (tr)]
[rumext.alpha :as mf]
[uxbox.util.router :as r]
[uxbox.util.time :as dt]))
@ -102,16 +102,16 @@
[:div.document-history.tool-window {}
[:div.tool-window-bar {}
[:div.tool-window-icon {} i/undo-history]
[:span {} (tr "ds.document-history")]
[:span {} (tr "ds.settings.document-history")]
[:div.tool-window-close {:on-click close} i/close]]
[:div.tool-window-content {}
[:ul.history-tabs {}
[:li {:on-click show-main
:class (when main? "selected")}
"History"]
(tr "ds.history.versions")]
[:li {:on-click show-pinned
:class (when pinned? "selected")}
"Pinned"]]
(tr "ds.history.pinned")]]
(if (= section :pinned)
(history-pinned-list history)
(history-list history))]])))
@ -131,5 +131,5 @@
{:class (when (:deselecting history) "hide-message")}
[:span {} (tr "history.alert-message" (or version "00"))
[:div.message-action {}
[:a.btn-transparent {:on-click on-accept} "Accept"]
[:a.btn-transparent {:on-click on-cancel} "Cancel"]]]]))))
[:a.btn-transparent {:on-click on-accept} (tr "ds.accept")]
[:a.btn-transparent {:on-click on-cancel} (tr "ds.cancel")]]]]))))

View file

@ -18,7 +18,8 @@
[uxbox.main.ui.shapes.icon :as icon]
[uxbox.util.data :refer (read-string)]
[uxbox.util.dom :as dom]
[uxbox.util.router :as r]))
[uxbox.util.router :as r]
[uxbox.util.i18n :refer (tr)]))
;; --- Refs
@ -69,7 +70,7 @@
[:div#form-figures.tool-window
[:div.tool-window-bar
[:div.tool-window-icon i/icon-set]
[:span "Icons"]
[:span (tr "ds.settings.icons")]
[:div.tool-window-close {:on-click on-close} i/close]]
[:div.tool-window-content
[:div.figures-catalog

View file

@ -19,7 +19,8 @@
[uxbox.main.ui.shapes.icon :as icon]
[uxbox.main.ui.workspace.sortable :refer [use-sortable]]
[uxbox.util.data :refer [classnames]]
[uxbox.util.dom :as dom]))
[uxbox.util.dom :as dom]
[uxbox.util.i18n :refer (tr)]))
;; --- Helpers
@ -170,7 +171,7 @@
[:div#layers.tool-window
[:div.tool-window-bar
[:div.tool-window-icon i/layers]
[:span "Layers"]
[:span (tr "ds.settings.layers")]
[:div.tool-window-close {:on-click on-click} i/close]]
[:& layers-list {:shapes (:shapes page)
:selected selected}]]))

View file

@ -28,7 +28,7 @@
[uxbox.main.ui.workspace.sidebar.options.text :as options-text]
[uxbox.util.data :as data]
[uxbox.util.dom :as dom]
[uxbox.util.i18n :refer [tr]]))
[uxbox.util.i18n :refer (tr)]))
;; --- Constants
@ -42,43 +42,43 @@
::page [::page-measures ::page-grid-options]})
(def ^:private +menus+
[{:name "Size, position & rotation"
[{:name (tr "element.measures")
:id ::icon-measures
:icon i/infocard
:comp options-iconm/icon-measures-menu}
{:name "Size, position & rotation"
{:name (tr "element.measures")
:id ::image-measures
:icon i/infocard
:comp options-imagem/image-measures-menu}
{:name "Size, position & rotation"
{:name (tr "element.measures")
:id ::rect-measures
:icon i/infocard
:comp options-rectm/rect-measures-menu}
{:name "Size, position & rotation"
{:name (tr "element.measures")
:id ::circle-measures
:icon i/infocard
:comp options-circlem/circle-measures-menu}
{:name "Fill"
{:name (tr "element.fill")
:id ::fill
:icon i/fill
:comp options-fill/fill-menu}
{:name "Stroke"
{:name (tr "element.fill")
:id ::stroke
:icon i/stroke
:comp options-stroke/stroke-menu}
{:name "Text"
{:name (tr "element.text")
:id ::text
:icon i/text
:comp options-text/text-menu}
{:name "Interactions"
{:name (tr "element.interactions")
:id ::interactions
:icon i/action
:comp options-interactions/interactions-menu}
{:name "Page settings"
{:name (tr "element.page-measures")
:id ::page-measures
:icon i/page
:comp options-page/measures-menu}
{:name "Grid settings"
{:name (tr "element.page-grid-options")
:id ::page-grid-options
:icon i/grid
:comp options-page/grid-options-menu}])
@ -116,7 +116,7 @@
[:div.elementa-options.tool-window
[:div.tool-window-bar
[:div.tool-window-icon i/options]
[:span (tr "ds.element-options")]
[:span (tr "ds.settings.element-options")]
[:div.tool-window-close {:on-click close} i/close]]
[:div.tool-window-content
[:div.element-options

View file

@ -15,7 +15,7 @@
[uxbox.main.ui.workspace.colorpicker :refer [colorpicker-modal]]
[uxbox.util.data :refer [parse-float]]
[uxbox.util.dom :as dom]
[uxbox.util.i18n :refer [tr]]))
[uxbox.util.i18n :refer (tr)]))
(mf/defc fill-menu
[{:keys [menu shape]}]

View file

@ -20,6 +20,7 @@
[uxbox.main.ui.workspace.colorpicker :refer [colorpicker-modal]]
[uxbox.util.data :refer [parse-int]]
[uxbox.util.dom :as dom]
[uxbox.util.i18n :refer [tr]]
[uxbox.util.spec :refer [color?]]))
(mf/defc measures-menu

View file

@ -106,7 +106,7 @@
[:div.sitemap.tool-window
[:div.tool-window-bar
[:div.tool-window-icon i/project-tree]
[:span (tr "ds.sitemap")]
[:span (tr "ds.settings.sitemap")]
[:div.tool-window-close {:on-click close} i/close]]
[:div.tool-window-content
[:div.project-title

View file

@ -17,7 +17,7 @@
[uxbox.util.data :refer [parse-int]]
[uxbox.util.dom :as dom]
[uxbox.util.forms :as fm]
[uxbox.util.i18n :refer [tr]]
[uxbox.util.i18n :refer (tr)]
[uxbox.util.router :as r]
[rumext.core :as mx :include-macros true]))
@ -88,16 +88,16 @@
(st/emit! (udp/persist-page-update-form id data))))]
[:form
[:input#project-name.input-text
{:placeholder "Page name"
{:placeholder (tr "ds.page.placeholder")
:type "text"
:value (:name data "")
:auto-focus true
:on-change update-name}]
[:div.project-size
[:div.input-element.pixels
[:span "Width"]
[:span (tr "ds.width")]
[:input#project-witdh.input-text
{:placeholder "Width"
{:placeholder (tr "ds.width")
:type "number"
:min 0
:max 4000
@ -105,9 +105,9 @@
:on-change #(update-size :width %)}]]
[:a.toggle-layout {:on-click toggle-sizes} i/toggle]
[:div.input-element.pixels
[:span "Height"]
[:span (tr "ds.height")]
[:input#project-height.input-text
{:placeholder "Height"
{:placeholder (tr "ds.height")
:type "number"
:min 0
:max 4000
@ -121,7 +121,7 @@
(layout-input data "desktop")]
[:input#project-btn.btn-primary
{:value "Go go go!"
{:value (tr "ds.go")
:disabled (not valid?)
:on-click on-save
:type "button"}]])))
@ -135,8 +135,8 @@
(let [creation? (nil? id)]
[:div.lightbox-body
(if creation?
[:h3 "New page"]
[:h3 "Edit page"])
[:h3 (tr "ds.page.new")]
[:h3 (tr "ds.page.edit")])
(page-form page)
[:a.close {:on-click on-cancel} i/close]])))