diff --git a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue index b1e35b81..41d5f7c1 100644 --- a/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue +++ b/src/component/Canvas/CanvasEditor/components/HeaderMenu.vue @@ -281,7 +281,7 @@ onMounted(() => { " -->
- {{ $t("宽度") }} + {{ $t("Canvas.width") }} { />
- {{ $t("高度") }} + {{ $t("Canvas.height") }} { />
- {{ $t("颜色") }} + {{ $t("Canvas.color") }}
import { ref, inject, onMounted } from "vue"; import { Skeleton } from "ant-design-vue"; +import { useI18n } from 'vue-i18n' +const {t} = useI18n() const loading = ref(true); const shortcuts = ref([]); @@ -44,17 +46,17 @@ function convertShortcuts(managerShortcuts) { // 基本的Action到显示名称的映射 const actionDisplayMap = { - undo: "撤销", - redo: "重做", - delete: "删除选中元素", + undo: t('Canvas.Undo'), + redo: t('Canvas.Redo'), + delete: t('Canvas.DeleteSelectedElement'), selectAll: "全选", - copy: "复制", - paste: "粘贴", - cut: "剪切", + copy: t('Canvas.Copy'), + paste: t('Canvas.Pase'), + cut: t('Canvas.Cut'), save: "保存", selectTool: "选择工具", - increaseBrushSize: "增加笔触大小", - decreaseBrushSize: "减小笔触大小", + increaseBrushSize: t('Canvas.DecreaseBrush'), + decreaseBrushSize: t('Canvas.IncreaseBrush'), toggleTempTool: "临时切换工具", // newLayer: "新建图层", // groupLayers: "组合图层", @@ -64,15 +66,15 @@ function convertShortcuts(managerShortcuts) { // 工具ID到显示名称的映射 const toolDisplayMap = { - select: "选择模式", - draw: "绘画模式", - eraser: "橡皮擦模式", - // eyedropper: "吸色工具", - pan: "移动画布", - lasso: "套索工具", - // area_custom: "自由选区工具", - // wave: "波浪工具", - liquify: "液化工具", + select: t('Canvas.SelectionMode'), + draw: t('Canvas.PaintingMode'), + eraser: t('Canvas.EraserMode'), + // eyedropper: t('Canvas.Cut'), + pan: '移动画布', + lasso: t('Canvas.LassoTool'), + // area_custom: t('Canvas.Cut'), + // wave: t('Canvas.Cut'), + liquify: t('Canvas.LiquifyTool'), }; // 处理每个快捷键 @@ -95,9 +97,9 @@ function convertShortcuts(managerShortcuts) { // 添加一些组件特定的快捷键 result.push({ - action: "缩放画布", - windows: "鼠标滚轮", - mac: "鼠标滚轮 或 触控板缩放手势", + action: t('Canvas.ZoomCanvas'), + windows: t('Canvas.MouseWheel'), + mac: t('Canvas.MacZoomCanvas'), touch: "双指捏合", }); @@ -268,11 +270,11 @@ function getShortcutsByCategory(category) {