mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 20:36:10 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
9a965dc693
8 changed files with 167 additions and 213 deletions
|
@ -10,16 +10,18 @@
|
|||
[app.common.geom.point :as gpt]
|
||||
[clojure.data.fressian :as fres])
|
||||
(:import
|
||||
clojure.lang.Ratio
|
||||
org.fressian.handlers.WriteHandler
|
||||
org.fressian.handlers.ReadHandler
|
||||
org.fressian.Writer
|
||||
org.fressian.Reader
|
||||
org.fressian.StreamingWriter
|
||||
app.common.geom.matrix.Matrix
|
||||
app.common.geom.point.Point
|
||||
clojure.lang.Ratio
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.ByteArrayOutputStream))
|
||||
java.io.ByteArrayOutputStream
|
||||
java.time.Instant
|
||||
java.time.OffsetDateTime
|
||||
org.fressian.Reader
|
||||
org.fressian.StreamingWriter
|
||||
org.fressian.Writer
|
||||
org.fressian.handlers.ReadHandler
|
||||
org.fressian.handlers.WriteHandler))
|
||||
|
||||
;; --- MISC
|
||||
|
||||
|
@ -92,6 +94,20 @@
|
|||
(.-e ^Matrix o)
|
||||
(.-f ^Matrix o)))))}
|
||||
|
||||
Instant
|
||||
{"java/instant"
|
||||
(reify WriteHandler
|
||||
(write [_ w ch]
|
||||
(.writeTag w "java/instant" 1)
|
||||
(.writeInt w (.toEpochMilli ^Instant ch))))}
|
||||
|
||||
OffsetDateTime
|
||||
{"java/instant"
|
||||
(reify WriteHandler
|
||||
(write [_ w ch]
|
||||
(.writeTag w "java/instant" 1)
|
||||
(.writeInt w (.toEpochMilli ^Instant (.toInstant ^OffsetDateTime ch)))))}
|
||||
|
||||
Ratio
|
||||
{"ratio"
|
||||
(reify WriteHandler
|
||||
|
@ -181,6 +197,12 @@
|
|||
(read [_ rdr _ _]
|
||||
(char (.readObject rdr))))
|
||||
|
||||
"java/instant"
|
||||
(reify ReadHandler
|
||||
(read [_ rdr _ _]
|
||||
(Instant/ofEpochMilli (.readInt rdr))))
|
||||
|
||||
|
||||
"clj/ratio"
|
||||
(reify ReadHandler
|
||||
(read [_ rdr _ _]
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
(defn parse
|
||||
[data]
|
||||
(cond
|
||||
(= data "%version%")
|
||||
(str/starts-with? data "%")
|
||||
{:full "develop"
|
||||
:branch "develop"
|
||||
:base "0.0.0"
|
||||
|
|
|
@ -1,73 +0,0 @@
|
|||
const l = require("lodash");
|
||||
const fs = require("fs");
|
||||
const gt = require("gettext-parser");
|
||||
|
||||
function generateLang(data, lang) {
|
||||
let output = {};
|
||||
|
||||
for (let key of Object.keys(data)) {
|
||||
const trObj = data[key];
|
||||
const trRef = trObj["used-in"];
|
||||
|
||||
let content = trObj.translations[lang];
|
||||
let comments = {};
|
||||
|
||||
if (l.isNil(content)) {
|
||||
continue;
|
||||
} else {
|
||||
let result = {
|
||||
msgid: key,
|
||||
comments: {}
|
||||
}
|
||||
|
||||
if (l.isArray(trRef)) {
|
||||
result.comments.reference = trRef.join(", ");
|
||||
}
|
||||
|
||||
if (trObj.permanent) {
|
||||
result.comments.flag = "permanent";
|
||||
}
|
||||
|
||||
if (l.isArray(content)) {
|
||||
result.msgid_plural = key;
|
||||
result.msgstr = content;
|
||||
} else if (l.isString(content)) {
|
||||
result.msgstr = [content];
|
||||
} else {
|
||||
throw new Error("unexpected");
|
||||
}
|
||||
|
||||
output[key] = result;
|
||||
}
|
||||
}
|
||||
|
||||
if (lang.includes("_")) {
|
||||
const [a, b] = lang.split("_");
|
||||
lang = `${a}_${b.toUpperCase()}`;
|
||||
}
|
||||
|
||||
const poData = {
|
||||
charset: "utf-8",
|
||||
headers: {
|
||||
"Language": lang,
|
||||
"MIME-Version": "1.0",
|
||||
"Content-Type": "text/plain; charset=UTF-8",
|
||||
"Content-Transfer-Encoding": "8bit",
|
||||
"Plural-Forms": "nplurals=2; plural=(n != 1);"
|
||||
},
|
||||
"translations": {
|
||||
"": output
|
||||
}
|
||||
}
|
||||
const buff = gt.po.compile(poData, {sort: true});
|
||||
fs.writeFileSync(`./translations/${lang}.po`, buff);
|
||||
}
|
||||
|
||||
const content = fs.readFileSync("./resources/locales.json");
|
||||
const data = JSON.parse(content);
|
||||
const langs = ["de"];
|
||||
|
||||
for (let lang of langs) {
|
||||
generateLang(data, lang);
|
||||
}
|
||||
|
|
@ -242,7 +242,8 @@
|
|||
|
||||
(nil? frame)
|
||||
[:section.empty-state
|
||||
[:span (tr "viewer.frame-not-found")]]
|
||||
(when (some? index)
|
||||
[:span (tr "viewer.frame-not-found")])]
|
||||
|
||||
(some? frame)
|
||||
(if (= :handoff section)
|
||||
|
|
|
@ -433,6 +433,8 @@
|
|||
[:label {:for (str "background-" index)}
|
||||
(tr "workspace.options.interaction-background")]]]])
|
||||
|
||||
(when (cti/has-animation? interaction)
|
||||
[:*
|
||||
; Animation select
|
||||
[:div.interactions-element.separator
|
||||
[:span.element-set-subtitle.wide (tr "workspace.options.interaction-animation")]
|
||||
|
@ -521,7 +523,7 @@
|
|||
:checked (-> interaction :animation :offset-effect)
|
||||
:on-change change-offset-effect}]
|
||||
[:label {:for (str "offset-effect-" index)}
|
||||
(tr "workspace.options.interaction-offset-effect")]]])])]]))
|
||||
(tr "workspace.options.interaction-offset-effect")]]])])])]]))
|
||||
|
||||
(mf/defc interactions-menu
|
||||
[{:keys [shape] :as props}]
|
||||
|
|
|
@ -478,7 +478,9 @@
|
|||
([uri name]
|
||||
(open-new-window uri name "noopener,noreferrer"))
|
||||
([uri name features]
|
||||
(.open js/window (str uri) name features)))
|
||||
(let [new-window (.open js/window (str uri) name features)]
|
||||
(when (not= name "_blank")
|
||||
(.reload (.-location new-window))))))
|
||||
|
||||
(defn browser-back
|
||||
[]
|
||||
|
|
|
@ -925,6 +925,9 @@ msgstr "Code"
|
|||
msgid "handoff.tabs.code.selected.circle"
|
||||
msgstr "Circle"
|
||||
|
||||
msgid "handoff.tabs.code.selected.component"
|
||||
msgstr "Component"
|
||||
|
||||
msgid "handoff.tabs.code.selected.curve"
|
||||
msgstr "Curve"
|
||||
|
||||
|
@ -937,9 +940,6 @@ msgstr "Group"
|
|||
msgid "handoff.tabs.code.selected.image"
|
||||
msgstr "Image"
|
||||
|
||||
msgid "handoff.tabs.code.selected.component"
|
||||
msgstr "Component"
|
||||
|
||||
msgid "handoff.tabs.code.selected.mask"
|
||||
msgstr "Mask"
|
||||
|
||||
|
@ -2109,6 +2109,10 @@ msgstr "Show color palette"
|
|||
msgid "workspace.header.menu.show-rules"
|
||||
msgstr "Show rules"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.reset-zoom"
|
||||
msgstr "Reset"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.save-error"
|
||||
msgstr "Error on saving"
|
||||
|
@ -2126,32 +2130,28 @@ msgid "workspace.header.unsaved"
|
|||
msgstr "Unsaved changes"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.reset-zoom"
|
||||
msgstr "Reset"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit-all"
|
||||
msgstr "Zoom to fil all"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-selected"
|
||||
msgstr "Zoom to selected"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit"
|
||||
msgstr "Fit - Scale down to fit"
|
||||
msgid "workspace.header.viewer"
|
||||
msgstr "View mode (%s)"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fill"
|
||||
msgstr "Fill -Scale to fill"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit"
|
||||
msgstr "Fit - Scale down to fit"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit-all"
|
||||
msgstr "Zoom to fil all"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-full-screen"
|
||||
msgstr "Full screen"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.viewer"
|
||||
msgstr "View mode (%s)"
|
||||
msgid "workspace.header.zoom-selected"
|
||||
msgstr "Zoom to selected"
|
||||
|
||||
#: src/app/main/ui/workspace/libraries.cljs
|
||||
msgid "workspace.libraries.add"
|
||||
|
@ -2363,10 +2363,6 @@ msgstr "Exporting…"
|
|||
msgid "workspace.options.fill"
|
||||
msgstr "Fill"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/menus/fill.cljs
|
||||
msgid "workspace.options.show-fill-on-export"
|
||||
msgstr "Show in exports"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs
|
||||
msgid "workspace.options.flows.add-flow-start"
|
||||
msgstr "Add flow start"
|
||||
|
@ -2845,6 +2841,10 @@ msgstr "Group shadow"
|
|||
msgid "workspace.options.shadow-options.title.multiple"
|
||||
msgstr "Selection shadows"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/menus/fill.cljs
|
||||
msgid "workspace.options.show-fill-on-export"
|
||||
msgstr "Show in exports"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/shapes/frame.cljs, src/app/main/ui/workspace/sidebar/options/menus/measures.cljs
|
||||
msgid "workspace.options.size"
|
||||
msgstr "Size"
|
||||
|
|
|
@ -926,6 +926,9 @@ msgstr "Código"
|
|||
msgid "handoff.tabs.code.selected.circle"
|
||||
msgstr "Círculo"
|
||||
|
||||
msgid "handoff.tabs.code.selected.component"
|
||||
msgstr "Componente"
|
||||
|
||||
msgid "handoff.tabs.code.selected.curve"
|
||||
msgstr "Curva"
|
||||
|
||||
|
@ -938,9 +941,6 @@ msgstr "Grupo"
|
|||
msgid "handoff.tabs.code.selected.image"
|
||||
msgstr "Imagen"
|
||||
|
||||
msgid "handoff.tabs.code.selected.component"
|
||||
msgstr "Componente"
|
||||
|
||||
msgid "handoff.tabs.code.selected.mask"
|
||||
msgstr "Máscara"
|
||||
|
||||
|
@ -2124,6 +2124,10 @@ msgstr "Mostrar paleta de colores"
|
|||
msgid "workspace.header.menu.show-rules"
|
||||
msgstr "Mostrar reglas"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.reset-zoom"
|
||||
msgstr "Restablecer"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.save-error"
|
||||
msgstr "Error al guardar"
|
||||
|
@ -2141,32 +2145,28 @@ msgid "workspace.header.unsaved"
|
|||
msgstr "Cambios sin guardar"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.reset-zoom"
|
||||
msgstr "Restablecer"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit-all"
|
||||
msgstr "Zoom abarcar todo"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-selected"
|
||||
msgstr "Zoom a selección"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit"
|
||||
msgstr "Escalar para ajustar"
|
||||
msgid "workspace.header.viewer"
|
||||
msgstr "Modo de visualización (%s)"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fill"
|
||||
msgstr "Escalar para rellenar"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit"
|
||||
msgstr "Escalar para ajustar"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-fit-all"
|
||||
msgstr "Zoom abarcar todo"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.zoom-full-screen"
|
||||
msgstr "Pantalla completa"
|
||||
|
||||
#: src/app/main/ui/workspace/header.cljs
|
||||
msgid "workspace.header.viewer"
|
||||
msgstr "Modo de visualización (%s)"
|
||||
msgid "workspace.header.zoom-selected"
|
||||
msgstr "Zoom a selección"
|
||||
|
||||
#: src/app/main/ui/workspace/libraries.cljs
|
||||
msgid "workspace.libraries.add"
|
||||
|
@ -2378,10 +2378,6 @@ msgstr "Exportando"
|
|||
msgid "workspace.options.fill"
|
||||
msgstr "Relleno"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/menus/fill.cljs
|
||||
msgid "workspace.options.show-fill-on-export"
|
||||
msgstr "Mostrar al exportar"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/menus/interactions.cljs
|
||||
msgid "workspace.options.flows.add-flow-start"
|
||||
msgstr "Añadir inicio de flujo"
|
||||
|
@ -2858,6 +2854,10 @@ msgstr "Sombra del grupo"
|
|||
msgid "workspace.options.shadow-options.title.multiple"
|
||||
msgstr "Sombras de la seleccíón"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/menus/fill.cljs
|
||||
msgid "workspace.options.show-fill-on-export"
|
||||
msgstr "Mostrar al exportar"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/options/shapes/frame.cljs, src/app/main/ui/workspace/sidebar/options/menus/measures.cljs
|
||||
msgid "workspace.options.size"
|
||||
msgstr "Tamaño"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue