Skip to content

Commit 6dca813

Browse files
authored
fix(右键菜单): 右键菜单显示快捷建错误问题修复 (#535)
* fix(右键菜单): 右键菜单显示快捷建错误问题修复 * fix(翻转插件): 右键菜单,x和y轴翻转的国际化显示错误
1 parent 1a08d57 commit 6dca813

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

packages/core/plugin/CenterAlignPlugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
22
* @Author: 秦少卫
33
* @Date: 2023-06-15 22:49:42
4-
* @LastEditors: 秦少卫
5-
* @LastEditTime: 2024-07-09 14:12:41
4+
* @LastEditors: bigFace2019 599069310@qq.com
5+
* @LastEditTime: 2024-11-03 20:39:43
66
* @Description: 居中对齐插件
77
*/
88

@@ -59,7 +59,7 @@ class CenterAlignPlugin implements IPluginTempl {
5959
return [
6060
{
6161
text: '水平垂直居中',
62-
hotkey: 'Ctrl+V',
62+
hotkey: '',
6363
disabled: false,
6464
onclick: () => this.position('center'),
6565
},

packages/core/plugin/DeleteHotKeyPlugin.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
22
* @Author: 秦少卫
33
* @Date: 2023-06-20 12:57:35
4-
* @LastEditors: 秦少卫
5-
* @LastEditTime: 2024-04-10 17:33:02
4+
* @LastEditors: bigFace2019 599069310@qq.com
5+
* @LastEditTime: 2024-11-03 20:38:33
66
* @Description: 删除快捷键
77
*/
88

@@ -42,7 +42,10 @@ class DeleteHotKeyPlugin implements IPluginTempl {
4242
contextMenu() {
4343
const activeObject = this.canvas.getActiveObject();
4444
if (activeObject) {
45-
return [null, { text: '删除', hotkey: 'Ctrl+V', disabled: false, onclick: () => this.del() }];
45+
return [
46+
null,
47+
{ text: '删除', hotkey: 'Backspace', disabled: false, onclick: () => this.del() },
48+
];
4649
}
4750
}
4851

packages/core/plugin/FlipPlugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { fabric } from 'fabric';
22
import { SelectMode } from '../eventType';
33
import type { IEditor, IPluginTempl } from '@kuaitu/core';
4+
import i18n from "@/language";
45

56
type IPlugin = Pick<FlipPlugin, 'flip'>;
67

@@ -9,7 +10,6 @@ declare module '@kuaitu/core' {
910
interface IEditor extends IPlugin {}
1011
}
1112

12-
const t = (key: string) => key;
1313
// import event from '@/utils/event/notifier';
1414

1515
export default class FlipPlugin implements IPluginTempl {
@@ -34,12 +34,12 @@ export default class FlipPlugin implements IPluginTempl {
3434
hotkey: '❯',
3535
subitems: [
3636
{
37-
text: t('flip.x'),
37+
text: i18n.global.t('flip.x'),
3838
hotkey: '|',
3939
onclick: () => this.flip('X'),
4040
},
4141
{
42-
text: t('flip.y'),
42+
text: i18n.global.t('flip.y'),
4343
hotkey: '-',
4444
onclick: () => this.flip('Y'),
4545
},

src/language/zh.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
"width": "宽度",
77
"height": "高度"
88
},
9+
"flip": {
10+
"x": "水平翻转",
11+
"y": "垂直翻转"
12+
},
913
"attrSeting": {
1014
"group": "成组",
1115
"unGroup": "拆分组",
@@ -254,4 +258,4 @@
254258
},
255259
"mine": "我的",
256260
"batch": "批量"
257-
}
261+
}

0 commit comments

Comments
 (0)