-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.json
More file actions
224 lines (224 loc) · 6.5 KB
/
Copy pathpackage.json
File metadata and controls
224 lines (224 loc) · 6.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
{
"name": "translate-dict",
"displayName": "Translate Dict",
"description": "A pure, high-performance, and non-intrusive VS Code translation plugin based on ECDICT local dictionary. 一款纯粹、极速、无侵入的 VS Code 本地滑词翻译插件。",
"keywords": [
"translate",
"translation",
"dictionary",
"ecdict",
"hover-translate",
"local-dictionary",
"offline-translation",
"code-translation",
"滑词翻译",
"本地词典",
"翻译"
],
"version": "1.2.5",
"publisher": "fengzai6",
"scripts": {
"dev": "rollup -c -w",
"lint": "eslint . --ext .ts",
"type-check": "tsc --noEmit",
"pretest": "yarn lint && yarn type-check",
"package": "vsce package --allow-star-activation",
"update": "node ./scripts/update-dict.js",
"count": "node ./scripts/count-dict.js",
"build": "rollup -c && yarn package",
"test": "vitest run",
"test:watch": "vitest",
"bench": "vitest bench",
"test-compile": "tsc -p tsconfig.test.json",
"test:vscode": "yarn test-compile && node ./out/test/runTest.js"
},
"repository": {
"type": "git",
"url": "https://github.com/fengzai6/translate-dict.git"
},
"icon": "icon.png",
"engines": {
"vscode": "^1.88.0"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "translateDict.enableTranslation",
"title": "启用翻译",
"category": "Translate Dict"
},
{
"command": "translateDict.disableTranslation",
"title": "禁用翻译",
"category": "Translate Dict"
},
{
"command": "translateDict.toggleTranslationMode",
"title": "切换翻译触发模式",
"category": "Translate Dict"
},
{
"command": "translateDict.translateSelection",
"title": "翻译选中文本",
"category": "Translate Dict"
}
],
"keybindings": [
{
"command": "translateDict.translateSelection",
"key": "alt+t",
"when": "editorTextFocus"
}
],
"menus": {
"editor/context": [
{
"submenu": "translateDict.submenu",
"group": "z_commands",
"when": "editorTextFocus"
}
],
"translateDict.submenu": [
{
"command": "translateDict.enableTranslation",
"group": "translation"
},
{
"command": "translateDict.disableTranslation",
"group": "translation"
},
{
"command": "translateDict.toggleTranslationMode",
"group": "translation"
}
]
},
"submenus": [
{
"id": "translateDict.submenu",
"label": "Translate Dict"
}
],
"configuration": {
"title": "Translate Dict",
"properties": {
"translateDict.includeFileExtensions": {
"type": "array",
"default": [],
"description": "启用翻译的文件后缀列表(为空则对所有文件生效)。例如: [\"js\", \"ts\", \"py\"]",
"items": {
"type": "string"
}
},
"translateDict.excludeFileExtensions": {
"type": "array",
"default": [],
"description": "禁用翻译的文件后缀列表。例如: [\"md\", \"txt\", \"json\"]",
"items": {
"type": "string"
}
},
"translateDict.chineseToEnglishMaxResults": {
"type": "number",
"default": 10,
"minimum": 1,
"maximum": 50,
"description": "中译英最大显示结果数量,默认为 10"
},
"translateDict.defaultTranslatePlatform": {
"type": "string",
"default": "google",
"enum": [
"google",
"baidu",
"deepl",
"bing",
"yandex",
"custom"
],
"enumDescriptions": [
"Google翻译",
"百度翻译",
"DeepL翻译",
"必应翻译",
"Yandex翻译",
"自定义翻译平台"
],
"description": "默认翻译平台,用于 Markdown 中单词的跳转链接"
},
"translateDict.customTranslateUrl": {
"type": "string",
"default": "https://fanyi.baidu.com/#en/zh/{word}",
"description": "自定义翻译平台URL,使用 {word} 作为单词占位符,例如: https://fanyi.baidu.com/#en/zh/{word}"
},
"translateDict.translationMode": {
"type": "string",
"default": "hover",
"enum": [
"hover",
"shortcut"
],
"enumDescriptions": [
"悬浮即翻译:鼠标悬停在单词上自动显示翻译",
"快捷键翻译:选中文本后按 Alt+T 触发翻译"
],
"description": "翻译触发模式"
},
"translateDict.enableOnlineFallback": {
"type": "boolean",
"default": false,
"description": "当本地词库无结果时,尝试通过在线 API 获取翻译(需要网络连接)"
},
"translateDict.onlineFallbackApi": {
"type": "string",
"default": "auto",
"enum": [
"auto",
"google",
"yandex"
],
"enumDescriptions": [
"自动:优先使用 Google 翻译,失败时切换到 Yandex",
"仅使用 Google 翻译",
"仅使用 Yandex 翻译"
],
"description": "在线回退翻译使用的 API(仅在 enableOnlineFallback 为 true 时生效)"
}
}
}
},
"devDependencies": {
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-typescript": "^12.3.0",
"@types/glob": "^7.1.1",
"@types/mocha": "^7.0.2",
"@types/node": "^22.10.5",
"@types/vscode": "^1.88.0",
"@typescript-eslint/eslint-plugin": "^8.50.0",
"@typescript-eslint/parser": "^8.50.0",
"@vscode/test-web": "^0.0.15",
"adm-zip": "^0.5.16",
"axios": "^1.13.2",
"cli-progress": "^3.12.0",
"csv-parser": "^3.2.0",
"eslint": "^9.18.0",
"glob": "^7.1.6",
"mocha": "^7.1.2",
"rollup": "^4.53.5",
"rollup-plugin-copy": "^3.5.0",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"vitest": "^4.0.16",
"vscode-test": "^1.3.0"
},
"packageManager": "yarn@1.22.22"
}