画布语言适配问题修复
This commit is contained in:
@@ -46,17 +46,44 @@ function convertShortcuts(managerShortcuts) {
|
||||
|
||||
// 基本的Action到显示名称的映射
|
||||
const actionDisplayMap = {
|
||||
undo: t('Canvas.Undo'),
|
||||
redo: t('Canvas.Redo'),
|
||||
delete: t('Canvas.DeleteSelectedElement'),
|
||||
selectAll: "全选",
|
||||
copy: t('Canvas.Copy'),
|
||||
paste: t('Canvas.Pase'),
|
||||
cut: t('Canvas.Cut'),
|
||||
save: "保存",
|
||||
undo: {
|
||||
label:t('Canvas.Undo'),
|
||||
value:"撤销",
|
||||
},
|
||||
redo: {
|
||||
label:t('Canvas.Redo'),
|
||||
value:"重做",
|
||||
},
|
||||
delete: {
|
||||
label:t('Canvas.DeleteSelectedElement'),
|
||||
value:"删除选中元素",
|
||||
},
|
||||
selectAll: {
|
||||
label:"全选",
|
||||
value:"全选",
|
||||
},
|
||||
copy: {
|
||||
label:t('Canvas.Copy'),
|
||||
value:"复制",
|
||||
},
|
||||
paste: {
|
||||
label:t('Canvas.Pase'),
|
||||
value:"粘贴",
|
||||
},
|
||||
cut: {
|
||||
label:t('Canvas.Cut'),
|
||||
value:"剪切",
|
||||
},
|
||||
save: "保存",
|
||||
selectTool: "选择工具",
|
||||
increaseBrushSize: t('Canvas.DecreaseBrush'),
|
||||
decreaseBrushSize: t('Canvas.IncreaseBrush'),
|
||||
increaseBrushSize: {
|
||||
label:t('Canvas.DecreaseBrush'),
|
||||
value:"减少画笔大小",
|
||||
},
|
||||
decreaseBrushSize: {
|
||||
label:t('Canvas.IncreaseBrush'),
|
||||
value:"增加画笔大小",
|
||||
},
|
||||
toggleTempTool: "临时切换工具",
|
||||
// newLayer: "新建图层",
|
||||
// groupLayers: "组合图层",
|
||||
@@ -66,15 +93,34 @@ function convertShortcuts(managerShortcuts) {
|
||||
|
||||
// 工具ID到显示名称的映射
|
||||
const toolDisplayMap = {
|
||||
select: t('Canvas.SelectionMode'),
|
||||
draw: t('Canvas.PaintingMode'),
|
||||
eraser: t('Canvas.EraserMode'),
|
||||
select: {
|
||||
label:t('Canvas.SelectionMode'),
|
||||
value:"选择模式",
|
||||
},
|
||||
draw: {
|
||||
label:t('Canvas.PaintingMode'),
|
||||
value:"绘制模式",
|
||||
},
|
||||
eraser: {
|
||||
label:t('Canvas.EraserMode'),
|
||||
value:"橡皮擦模式",
|
||||
},
|
||||
// eyedropper: t('Canvas.Cut'),
|
||||
pan: '移动画布',
|
||||
lasso: t('Canvas.LassoTool'),
|
||||
// pan: '移动画布',
|
||||
pan: {
|
||||
label:t('Canvas.MoveCanvas'),
|
||||
value:"移动画布",
|
||||
},
|
||||
lasso: {
|
||||
label:t('Canvas.LassoTool'),
|
||||
value:"套索工具",
|
||||
},
|
||||
// area_custom: t('Canvas.Cut'),
|
||||
// wave: t('Canvas.Cut'),
|
||||
liquify: t('Canvas.LiquifyTool'),
|
||||
liquify: {
|
||||
label:t('Canvas.LiquifyTool'),
|
||||
value:"液化工具",
|
||||
},
|
||||
};
|
||||
|
||||
// 处理每个快捷键
|
||||
@@ -264,7 +310,7 @@ function getShortcutsByCategory(category) {
|
||||
// layer: ["新建图层", "组合图层", "取消组合", "合并图层"],
|
||||
};
|
||||
|
||||
return shortcuts.value.filter((s) => categoryMap[category]?.includes(s.action));
|
||||
return shortcuts.value.filter((s) => categoryMap[category]?.includes(s.action.value));
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -294,8 +340,8 @@ function getShortcutsByCategory(category) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in getShortcutsByCategory('basic')" :key="item.action">
|
||||
<td>{{ item.action }}</td>
|
||||
<tr v-for="item in getShortcutsByCategory('basic')" :key="item.action.label">
|
||||
<td>{{ item.action.label }}</td>
|
||||
<td>{{ getShortcutForCurrentPlatform(item) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -312,8 +358,8 @@ function getShortcutsByCategory(category) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in getShortcutsByCategory('view')" :key="item.action">
|
||||
<td>{{ item.action }}</td>
|
||||
<tr v-for="item in getShortcutsByCategory('view')" :key="item.action.label">
|
||||
<td>{{ item.action.label }}</td>
|
||||
<td>{{ getShortcutForCurrentPlatform(item) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -330,8 +376,8 @@ function getShortcutsByCategory(category) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in getShortcutsByCategory('tools')" :key="item.action">
|
||||
<td>{{ item.action }}</td>
|
||||
<tr v-for="item in getShortcutsByCategory('tools')" :key="item.action.label">
|
||||
<td>{{ item.action.label }}</td>
|
||||
<td>{{ getShortcutForCurrentPlatform(item) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -348,8 +394,8 @@ function getShortcutsByCategory(category) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in getShortcutsByCategory('brush')" :key="item.action">
|
||||
<td>{{ item.action }}</td>
|
||||
<tr v-for="item in getShortcutsByCategory('brush')" :key="item.action.label">
|
||||
<td>{{ item.action.label }}</td>
|
||||
<td>{{ getShortcutForCurrentPlatform(item) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -366,8 +412,8 @@ function getShortcutsByCategory(category) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in getShortcutsByCategory('layer')" :key="item.action">
|
||||
<td>{{ item.action }}</td>
|
||||
<tr v-for="item in getShortcutsByCategory('layer')" :key="item.action.label">
|
||||
<td>{{ item.action.label }}</td>
|
||||
<td>{{ getShortcutForCurrentPlatform(item) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user