shortcuts dev...

This commit is contained in:
Gabe Yuan
2023-09-07 18:12:45 +08:00
parent da13f5e218
commit d8b0cc4834
8 changed files with 11006 additions and 15315 deletions

View File

@@ -489,4 +489,20 @@ export const I18N = {
zh: `恢复默认`,
en: `Restore Default`,
},
shortcuts_setting: {
zh: `快捷键设置`,
en: `Shortcuts Setting`,
},
toggle_translate_shortcut: {
zh: `开启翻译快捷键`,
en: `Toggle Translate Shortcut`,
},
toggle_style_shortcut: {
zh: `切换样式快捷键`,
en: `Toggle Style Shortcut`,
},
toggle_popup_shortcut: {
zh: `打开弹窗快捷键`,
en: `Open Popup Shortcut`,
},
};

View File

@@ -238,6 +238,16 @@ export const DEFAULT_TRANS_APIS = {
},
};
// 默认快捷键
export const OPT_SHORTCUT_TRANSLATE = "toggleTranslate";
export const OPT_SHORTCUT_STYLE = "toggleStyle";
export const OPT_SHORTCUT_POPUP = "togglePopup";
export const DEFAULT_SHORTCUTS = {
[OPT_SHORTCUT_TRANSLATE]: ["Alt", "q"],
[OPT_SHORTCUT_STYLE]: ["Alt", "c"],
[OPT_SHORTCUT_POPUP]: ["Alt", "k"],
};
export const TRANS_MIN_LENGTH = 5; // 最短翻译长度
export const TRANS_MAX_LENGTH = 5000; // 最长翻译长度
export const TRANS_NEWLINE_LENGTH = 40; // 换行字符数
@@ -256,6 +266,7 @@ export const DEFAULT_SETTING = {
owSubrule: DEFAULT_OW_RULE, // 覆写订阅规则
transApis: DEFAULT_TRANS_APIS, // 翻译接口
mouseKey: OPT_MOUSEKEY_DISABLE, // 鼠标悬停翻译
shortcuts: DEFAULT_SHORTCUTS, // 快捷键
};
export const DEFAULT_RULES = [GLOBLA_RULE];