feat: support AI terms

This commit is contained in:
Gabe
2025-10-01 16:18:19 +08:00
parent 261bb7aa6f
commit 3c5ffc045f
8 changed files with 91 additions and 74 deletions

View File

@@ -668,6 +668,16 @@ export const I18N = {
en: `1. Supports regular expression matching, no slash required, and no modifiers are supported. 2. Separate multiple terms with newlines or semicolons ";". 3. Terms and translations are separated by English commas ",". 4. If there is no translation, the term will be deemed not to be translated.`,
zh_TW: `1. 支援正則表達式比對無需斜線且不支援修飾符。2. 多條術語以換行或分號「;」分隔。3. 術語與譯文以英文逗號「,」分隔。4. 無譯文者視為不翻譯該術語。`,
},
ai_terms: {
zh: `AI专业术语`,
en: `AI Terms`,
zh_TW: `AI專業術語`,
},
ai_terms_helper: {
zh: `1、AI智能替换不支持正则表达式。2、多条术语用换行或分号“;”隔开。3、术语和译文用英文逗号“,”隔开。4、没有译文视为不翻译术语。`,
en: `1. AI intelligent replacement does not support regular expressions.2. Separate multiple terms with newlines or semicolons ";". 3. Terms and translations are separated by English commas ",". 4. If there is no translation, the term will be deemed not to be translated.`,
zh_TW: `1.AI智能替換不支援正規表示式。2. 多條術語以換行或分號「;」分隔。3. 術語與譯文以英文逗號「,」分隔。4. 無譯文者視為不翻譯該術語。`,
},
selector_style: {
zh: `选择器节点样式`,
en: `Selector Style`,
@@ -1453,11 +1463,6 @@ export const I18N = {
en: `Placeholder tag name`,
zh_TW: `佔位標名`,
},
ai_terms: {
zh: `AI识别术语表`,
en: `AI Identification Glossary`,
zh_TW: `AI辨識術語表`,
},
system_prompt_helper: {
zh: `在未完全理解默认Prompt的情况下请勿随意修改否则可能翻译失败。`,
en: `If you do not fully understand the default prompt, please do not modify it at will, otherwise the translation may fail.`,

View File

@@ -80,6 +80,7 @@ export const DEFAULT_RULE = {
selector: "", // 选择器
keepSelector: "", // 保留元素选择器
terms: "", // 专业术语
aiTerms: "", // AI专业术语
apiSlug: GLOBAL_KEY, // 翻译服务
fromLang: GLOBAL_KEY, // 源语言
toLang: GLOBAL_KEY, // 目标语言
@@ -116,6 +117,7 @@ export const GLOBLA_RULE = {
selector: DEFAULT_SELECTOR, // 选择器
keepSelector: DEFAULT_KEEP_SELECTOR, // 保留元素选择器
terms: "", // 专业术语
aiTerms: "", // AI专业术语
apiSlug: OPT_TRANS_MICROSOFT, // 翻译服务
fromLang: "auto", // 源语言
toLang: "zh-CN", // 目标语言