mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 16:21:57 -05:00
🎉 Adds context menus texts into translations
This commit is contained in:
parent
33908413d6
commit
1706d13448
2 changed files with 186 additions and 47 deletions
|
@ -721,7 +721,7 @@
|
|||
"unused" : true
|
||||
},
|
||||
"ds.confirm-cancel" : {
|
||||
"used-in" : [ "src/app/main/ui/confirm.cljs:36" ],
|
||||
"used-in" : [ "src/app/main/ui/confirm.cljs:39" ],
|
||||
"translations" : {
|
||||
"en" : "Cancel",
|
||||
"fr" : "Annuler",
|
||||
|
@ -730,7 +730,7 @@
|
|||
}
|
||||
},
|
||||
"ds.confirm-ok" : {
|
||||
"used-in" : [ "src/app/main/ui/confirm.cljs:37" ],
|
||||
"used-in" : [ "src/app/main/ui/confirm.cljs:40" ],
|
||||
"translations" : {
|
||||
"en" : "Ok",
|
||||
"fr" : "Ok",
|
||||
|
@ -739,7 +739,7 @@
|
|||
}
|
||||
},
|
||||
"ds.confirm-title" : {
|
||||
"used-in" : [ "src/app/main/ui/confirm.cljs:35", "src/app/main/ui/confirm.cljs:39" ],
|
||||
"used-in" : [ "src/app/main/ui/confirm.cljs:38", "src/app/main/ui/confirm.cljs:42" ],
|
||||
"translations" : {
|
||||
"en" : "Are you sure?",
|
||||
"fr" : "Êtes-vous sûr?",
|
||||
|
@ -1600,31 +1600,31 @@
|
|||
}
|
||||
},
|
||||
"modals.delete-comment-thread.accept" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:236" ],
|
||||
"translations" : {
|
||||
"en" : null,
|
||||
"fr" : null,
|
||||
"es" : null,
|
||||
"ru" : null
|
||||
},
|
||||
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:236" ]
|
||||
"ru" : null,
|
||||
"es" : null
|
||||
}
|
||||
},
|
||||
"modals.delete-comment-thread.message" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:235" ],
|
||||
"translations" : {
|
||||
"en" : null,
|
||||
"fr" : null,
|
||||
"es" : null,
|
||||
"ru" : null
|
||||
},
|
||||
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:235" ]
|
||||
"ru" : null,
|
||||
"es" : null
|
||||
}
|
||||
},
|
||||
"modals.delete-comment-thread.title" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:234" ],
|
||||
"translations" : {
|
||||
"en" : null,
|
||||
"fr" : null,
|
||||
"es" : null,
|
||||
"ru" : null
|
||||
},
|
||||
"used-in" : [ "src/app/main/ui/workspace/comments.cljs:234" ]
|
||||
"ru" : null,
|
||||
"es" : null
|
||||
}
|
||||
},
|
||||
"modals.delete-file-confirm.accept" : {
|
||||
"used-in" : [ "src/app/main/ui/dashboard/grid.cljs:82" ],
|
||||
|
@ -2440,19 +2440,19 @@
|
|||
}
|
||||
},
|
||||
"workspace.libraries.colors.file-library" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/colorpicker/libraries.cljs:87", "src/app/main/ui/workspace/colorpalette.cljs:148" ],
|
||||
"used-in" : [ "src/app/main/ui/workspace/colorpicker/libraries.cljs:89", "src/app/main/ui/workspace/colorpalette.cljs:148" ],
|
||||
"translations" : {
|
||||
"en" : "File library"
|
||||
}
|
||||
},
|
||||
"workspace.libraries.colors.recent-colors" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/colorpicker/libraries.cljs:86", "src/app/main/ui/workspace/colorpalette.cljs:158" ],
|
||||
"used-in" : [ "src/app/main/ui/workspace/colorpicker/libraries.cljs:88", "src/app/main/ui/workspace/colorpalette.cljs:158" ],
|
||||
"translations" : {
|
||||
"en" : "Recent colors"
|
||||
}
|
||||
},
|
||||
"workspace.libraries.colors.save-color" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/colorpicker.cljs:338" ],
|
||||
"used-in" : [ "src/app/main/ui/workspace/colorpicker.cljs:339" ],
|
||||
"translations" : {
|
||||
"en" : "Save color"
|
||||
}
|
||||
|
@ -3361,6 +3361,138 @@
|
|||
"es" : "Usa el botón de play de la cabecera para arrancar la vista de prototipo."
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.back" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:103" ],
|
||||
"translations" : {
|
||||
"en" : "Send to back"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.backward" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:100" ],
|
||||
"translations" : {
|
||||
"en" : "Send backward"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.copy" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:81" ],
|
||||
"translations" : {
|
||||
"en" : "Copy"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.create-component" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:145" ],
|
||||
"translations" : {
|
||||
"en" : "Create component"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.cut" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:84" ],
|
||||
"translations" : {
|
||||
"en" : "Cut"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.delete" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:163" ],
|
||||
"translations" : {
|
||||
"en" : "Delete"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.detach-instance" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:152" ],
|
||||
"translations" : {
|
||||
"en" : "Detach instance"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.duplicate" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:90" ],
|
||||
"translations" : {
|
||||
"en" : "Duplicate"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.forward" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:94" ],
|
||||
"translations" : {
|
||||
"en" : "Bring forward"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.front" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:97" ],
|
||||
"translations" : {
|
||||
"en" : "Bring to front"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.go-master" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:159" ],
|
||||
"translations" : {
|
||||
"en" : "Go to master component file"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.group" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:110" ],
|
||||
"translations" : {
|
||||
"en" : "Group"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.hide" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:133" ],
|
||||
"translations" : {
|
||||
"en" : "Hide"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.lock" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:139" ],
|
||||
"translations" : {
|
||||
"en" : "Lock"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.mask" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:113" ],
|
||||
"translations" : {
|
||||
"en" : "Mask"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.paste" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:87", "src/app/main/ui/workspace/context_menu.cljs:172" ],
|
||||
"translations" : {
|
||||
"en" : "Paste"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.reset-overrides" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:154" ],
|
||||
"translations" : {
|
||||
"en" : "Reset overrides"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.show" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:131" ],
|
||||
"translations" : {
|
||||
"en" : "Show"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.ungroup" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:119" ],
|
||||
"translations" : {
|
||||
"en" : "Ungroup"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.unlock" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:137" ],
|
||||
"translations" : {
|
||||
"en" : "Unlock"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.unmask" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:123" ],
|
||||
"translations" : {
|
||||
"en" : "Unmask"
|
||||
}
|
||||
},
|
||||
"workspace.shape.menu.update-master" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/context_menu.cljs:157" ],
|
||||
"translations" : {
|
||||
"en" : "Update master component"
|
||||
}
|
||||
},
|
||||
"workspace.sidebar.icons" : {
|
||||
"translations" : {
|
||||
"en" : "Icons",
|
||||
|
@ -3486,7 +3618,7 @@
|
|||
}
|
||||
},
|
||||
"workspace.undo.empty" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/sidebar/history.cljs:290" ],
|
||||
"used-in" : [ "src/app/main/ui/workspace/sidebar/history.cljs:294" ],
|
||||
"translations" : {
|
||||
"en" : "There are no history changes so far"
|
||||
}
|
||||
|
@ -3702,13 +3834,13 @@
|
|||
}
|
||||
},
|
||||
"workspace.undo.title" : {
|
||||
"used-in" : [ "src/app/main/ui/workspace/sidebar/history.cljs:286" ],
|
||||
"used-in" : [ "src/app/main/ui/workspace/sidebar/history.cljs:290" ],
|
||||
"translations" : {
|
||||
"en" : "History"
|
||||
}
|
||||
},
|
||||
"workspace.updates.dismiss" : {
|
||||
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:542" ],
|
||||
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:541" ],
|
||||
"translations" : {
|
||||
"en" : "Dismiss",
|
||||
"fr" : "",
|
||||
|
@ -3717,7 +3849,7 @@
|
|||
}
|
||||
},
|
||||
"workspace.updates.there-are-updates" : {
|
||||
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:538" ],
|
||||
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:537" ],
|
||||
"translations" : {
|
||||
"en" : "There are updates in shared libraries",
|
||||
"fr" : "",
|
||||
|
@ -3726,7 +3858,7 @@
|
|||
}
|
||||
},
|
||||
"workspace.updates.update" : {
|
||||
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:540" ],
|
||||
"used-in" : [ "src/app/main/data/workspace/libraries.cljs:539" ],
|
||||
"translations" : {
|
||||
"en" : "Update",
|
||||
"fr" : "",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
[app.main.streams :as ms]
|
||||
[app.main.ui.icons :as i]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.i18n :refer [t] :as i18n]
|
||||
[app.main.data.workspace :as dw]
|
||||
[app.main.data.workspace.common :as dwc]
|
||||
[app.main.data.workspace.libraries :as dwl]
|
||||
|
@ -45,12 +46,14 @@
|
|||
|
||||
(mf/defc shape-context-menu
|
||||
[{:keys [mdata] :as props}]
|
||||
(let [{:keys [id] :as shape} (:shape mdata)
|
||||
(let [locale (mf/deref i18n/locale)
|
||||
{:keys [id] :as shape} (:shape mdata)
|
||||
selected (:selected mdata)
|
||||
|
||||
do-duplicate #(st/emit! dw/duplicate-selected)
|
||||
do-delete #(st/emit! dw/delete-selected)
|
||||
do-copy #(st/emit! dw/copy-selected)
|
||||
do-cut #(st/emit! dw/copy-selected dw/delete-selected)
|
||||
do-paste #(st/emit! dw/paste)
|
||||
do-bring-forward #(st/emit! (dw/vertical-order-selected :up))
|
||||
do-bring-to-front #(st/emit! (dw/vertical-order-selected :top))
|
||||
|
@ -75,46 +78,49 @@
|
|||
do-navigate-component-file #(st/emit! (dwl/nav-to-component-file
|
||||
(:component-file shape)))]
|
||||
[:*
|
||||
[:& menu-entry {:title "Copy"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.copy")
|
||||
:shortcut "Ctrl + c"
|
||||
:on-click do-copy}]
|
||||
[:& menu-entry {:title "Paste"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.cut")
|
||||
:shortcut "Ctrl + x"
|
||||
:on-click do-cut}]
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.paste")
|
||||
:shortcut "Ctrl + v"
|
||||
:on-click do-paste}]
|
||||
[:& menu-entry {:title "Duplicate"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.duplicate")
|
||||
:shortcut "Ctrl + d"
|
||||
:on-click do-duplicate}]
|
||||
[:& menu-separator]
|
||||
[:& menu-entry {:title "Bring forward"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.forward")
|
||||
:shortcut "Ctrl + ↑"
|
||||
:on-click do-bring-forward}]
|
||||
[:& menu-entry {:title "Bring to front"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.front")
|
||||
:shortcut "Ctrl + Shift + ↑"
|
||||
:on-click do-bring-to-front}]
|
||||
[:& menu-entry {:title "Send backward"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.backward")
|
||||
:shortcut "Ctrl + ↓"
|
||||
:on-click do-send-backward}]
|
||||
[:& menu-entry {:title "Send to back"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.back")
|
||||
:shortcut "Ctrl + Shift + ↓"
|
||||
:on-click do-send-to-back}]
|
||||
[:& menu-separator]
|
||||
|
||||
(when (> (count selected) 1)
|
||||
[:*
|
||||
[:& menu-entry {:title "Group"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.group")
|
||||
:shortcut "Ctrl + g"
|
||||
:on-click do-create-group}]
|
||||
[:& menu-entry {:title "Mask"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.mask")
|
||||
:shortcut "Ctrl + M"
|
||||
:on-click do-mask-group}]])
|
||||
|
||||
(when (and (= (count selected) 1) (= (:type shape) :group))
|
||||
[:*
|
||||
[:& menu-entry {:title "Ungroup"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.ungroup")
|
||||
:shortcut "Shift + g"
|
||||
:on-click do-remove-group}]
|
||||
(if (:masked-group? shape)
|
||||
[:& menu-entry {:title "Unmask"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.unmask")
|
||||
:shortcut "Shift + M"
|
||||
:on-click do-unmask-group}]
|
||||
[:& menu-entry {:title "Mask"
|
||||
|
@ -122,47 +128,48 @@
|
|||
:on-click do-mask-group}])])
|
||||
|
||||
(if (:hidden shape)
|
||||
[:& menu-entry {:title "Show"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.show")
|
||||
:on-click do-show-shape}]
|
||||
[:& menu-entry {:title "Hide"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.hide")
|
||||
:on-click do-hide-shape}])
|
||||
|
||||
(if (:blocked shape)
|
||||
[:& menu-entry {:title "Unlock"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.unlock")
|
||||
:on-click do-unlock-shape}]
|
||||
[:& menu-entry {:title "Lock"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.lock")
|
||||
:on-click do-lock-shape}])
|
||||
|
||||
(when (nil? (:shape-ref shape))
|
||||
[:*
|
||||
[:& menu-separator]
|
||||
[:& menu-entry {:title "Create component"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.create-component")
|
||||
:shortcut "Ctrl + K"
|
||||
:on-click do-add-component}]])
|
||||
|
||||
(when (:component-id shape)
|
||||
[:*
|
||||
[:& menu-separator]
|
||||
[:& menu-entry {:title "Detach instance"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.detach-instance")
|
||||
:on-click do-detach-component}]
|
||||
[:& menu-entry {:title "Reset overrides"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.reset-overrides")
|
||||
:on-click do-reset-component}]
|
||||
(if (nil? (:component-file shape))
|
||||
[:& menu-entry {:title "Update master component"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.update-master")
|
||||
:on-click do-update-component}]
|
||||
[:& menu-entry {:title "Go to master component file"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.go-master")
|
||||
:on-click do-navigate-component-file}])])
|
||||
|
||||
[:& menu-separator]
|
||||
[:& menu-entry {:title "Delete"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.delete")
|
||||
:shortcut "Supr"
|
||||
:on-click do-delete}]]))
|
||||
|
||||
(mf/defc viewport-context-menu
|
||||
[{:keys [mdata] :as props}]
|
||||
(let [do-paste #(st/emit! dw/paste)]
|
||||
(let [locale (mf/deref i18n/locale)
|
||||
do-paste #(st/emit! dw/paste)]
|
||||
[:*
|
||||
[:& menu-entry {:title "Paste"
|
||||
[:& menu-entry {:title (t locale "workspace.shape.menu.paste")
|
||||
:shortcut "Ctrl + v"
|
||||
:on-click do-paste}]]))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue