input box trans

This commit is contained in:
Gabe Yuan
2023-09-13 15:53:40 +08:00
parent f8c8a4ebeb
commit 0ea97b73e3
11 changed files with 312 additions and 52 deletions

View File

@@ -547,4 +547,28 @@ export const I18N = {
zh: `全局规则`,
en: `Global Rule`,
},
input_setting: {
zh: `输入框设置`,
en: `Input Box Setting`,
},
input_box_translation: {
zh: `启用输入框翻译`,
en: `Input Box Translation`,
},
input_selector: {
zh: `输入框选择器`,
en: `Input Selector`,
},
input_selector_helper: {
zh: `用于输入框翻译。`,
en: `Used for input box translation.`,
},
trigger_trans_shortcut: {
zh: `触发翻译快捷键`,
en: `Trigger Translation Shortcut Keys`,
},
trigger_trans_count: {
zh: `触发翻译连击次数`,
en: `Trigger Translation Press Nunber`,
},
};

View File

@@ -189,6 +189,7 @@ export const DEFAULT_COLOR = "#209CEE"; // 默认高亮背景色/线条颜色
export const GLOBLA_RULE = {
pattern: "*",
selector: DEFAULT_SELECTOR,
inputSelector: "",
translator: OPT_TRANS_MICROSOFT,
fromLang: "auto",
toLang: "zh-CN",
@@ -198,6 +199,15 @@ export const GLOBLA_RULE = {
textDiyStyle: "",
};
export const DEFAULT_INPUT_RULE = {
transOpen: true,
translator: OPT_TRANS_MICROSOFT,
fromLang: "auto",
toLang: "en",
triggerShortcut: ["Alt", "i"],
triggerCount: 1,
};
// 订阅列表
export const DEFAULT_SUBRULES_LIST = [
{
@@ -273,6 +283,7 @@ export const DEFAULT_SETTING = {
mouseKey: OPT_MOUSEKEY_DISABLE, // 鼠标悬停翻译
shortcuts: DEFAULT_SHORTCUTS, // 快捷键
hideFab: false, // 是否隐藏按钮
inputRule: DEFAULT_INPUT_RULE, // 输入框设置
};
export const DEFAULT_RULES = [GLOBLA_RULE];

View File

@@ -10,6 +10,7 @@ export const SHADOW_KEY = ">>>";
export const DEFAULT_RULE = {
pattern: "",
selector: "",
inputSelector: "",
translator: GLOBAL_KEY,
fromLang: GLOBAL_KEY,
toLang: GLOBAL_KEY,