forked from jsc6924/translation-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
355 lines (355 loc) · 9.32 KB
/
package.json
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
{
"name": "translateassistant",
"displayName": "DLTXT: 双行文本翻译解决方案",
"publisher": "jsc723",
"icon": "assets/logo.png",
"description": "",
"version": "2.17.2",
"engines": {
"vscode": "^1.48.0"
},
"categories": [
"Programming Languages"
],
"activationEvents": [
"onLanguage:dltxt",
"onLanguage:sltxt"
],
"main": "./out/main.js",
"contributes": {
"languages": [
{
"id": "dltxt",
"aliases": [
"Double Line TXT for translation"
],
"extensions": [
".txt"
]
},
{
"id": "sltxt",
"aliases": [
"Single Line TXT translation extracted from dltxt"
],
"extensions": [
".txt.sl"
]
}
],
"grammars": [
{
"language": "dltxt",
"scopeName": "source.txt",
"path": "./syntaxes/dltxt.tmLanguage.json"
}
],
"themes": [
{
"label": "DLTXT Dark+",
"uiTheme": "vs-dark",
"path": "themes/dltxt_dark.json"
},
{
"label": "DLTXT Light+",
"uiTheme": "vs",
"path": "themes/dltxt_light.json"
}
],
"colors": [
{
"id": "myextension.largeNumberBackground",
"description": "Background decoration color for large numbers",
"defaults": {
"dark": "#FF000055",
"light": "#FF000055",
"highContrast": "#FF000055"
}
}
],
"commands": [
{
"command": "Extension.dltxt.sync_database",
"title": "DLTXT: 拉取云端词条"
},
{
"command": "Extension.dltxt.context_menu_insert",
"title": "DLTXT: 添加词条"
},
{
"command": "Extension.dltxt.context_menu_update",
"title": "DLTXT: 更新词条"
},
{
"command": "Extension.dltxt.extract_single_line",
"title": "DLTXT: 提取译文"
},
{
"command": "Extension.dltxt.merge_into_double_line",
"title": "DLTXT: 应用译文至双行文本"
},
{
"command": "Extension.dltxt.next",
"title": "DLTXT: 移动到下一行翻译"
},
{
"command": "Extension.dltxt.prev",
"title": "DLTXT: 移动到上一行翻译"
},
{
"command": "Extension.dltxt.moveToNextLine",
"title": "DLTXT: 将光标后剪切到下一行翻译"
},
{
"command": "Extension.dltxt.moveToPrevLine",
"title": "DLTXT: 将光标前剪切到上一行翻译"
},
{
"command": "Extension.dltxt.deleteAllAfter",
"title": "DLTXT: 将光标后的翻译全部删除"
},
{
"command": "Extension.dltxt.repeatFirst",
"title": "DLTXT: 重复当前句的第一个字"
},
{
"command": "Extension.dltxt.copy_original",
"title": "DLTXT: 复制原文到未翻译的译文行"
},
{
"command": "Extension.dltxt.nextWord",
"title": "DLTXT: 下一处翻译点"
},
{
"command": "Extension.dltxt.prevWord",
"title": "DLTXT: 上一处翻译点"
}
],
"keybindings": [
{
"command": "Extension.dltxt.next",
"key": "alt+enter"
},
{
"command": "Extension.dltxt.prev",
"key": "alt+\\"
},
{
"command": "Extension.dltxt.nextWord",
"key": "alt+]"
},
{
"command": "Extension.dltxt.prevWord",
"key": "alt+["
},
{
"command": "Extension.dltxt.next",
"key": "ctrl+enter"
},
{
"command": "Extension.dltxt.prev",
"key": "ctrl+\\"
},
{
"command": "Extension.dltxt.moveToNextLine",
"key": "ctrl+alt+enter"
},
{
"command": "Extension.dltxt.moveToPrevLine",
"key": "ctrl+alt+\\"
},
{
"command": "Extension.dltxt.deleteAllAfter",
"key": "alt+delete"
},
{
"command": "Extension.dltxt.repeatFirst",
"key": "ctrl+alt+space"
}
],
"menus": {
"editor/context": [
{
"when": "editorHasSelection && resourceLangId == dltxt",
"command": "Extension.dltxt.context_menu_insert",
"group": "dltxt.simpleTM.a"
},
{
"when": "editorHasSelection && resourceLangId == dltxt",
"command": "Extension.dltxt.context_menu_update",
"group": "dltxt.simpleTM.a"
},
{
"when": "resourceLangId == dltxt",
"command": "Extension.dltxt.extract_single_line",
"group": "dltxt.extract"
},
{
"when": "resourceLangId == dltxt || resourceLangId == sltxt",
"command": "Extension.dltxt.merge_into_double_line",
"group": "dltxt.extract"
},
{
"when": "resourceLangId == dltxt",
"command": "Extension.dltxt.copy_original",
"group": "dltxt.edit"
}
]
},
"configuration": {
"title": "dltxt",
"properties": {
"dltxt.simpleTM.remoteHost": {
"type": "string",
"default": "https://simpletm.jscrosoft.com/",
"description": "SimpleTM服务器网址"
},
"dltxt.simpleTM.username": {
"type": "string",
"description": "SimpleTM用户名"
},
"dltxt.simpleTM.apiToken": {
"type": "string",
"description": "SimpleTM APIToken (登录后可以在你的主页上找到)"
},
"dltxt.simpleTM.project": {
"type": "string",
"description": "SimpleTM项目名(建议在Workspace中填写)"
},
"dltxt.core.originalTextPrefixRegex": {
"type": "string",
"default": "(\\[[a-z0-9]+\\])|((★|○)[a-z0-9]+(★|○))|((<\\d+>)?//)",
"description": "原文开头标签的正则表达式"
},
"dltxt.core.translatedTextPrefixRegex": {
"type": "string",
"default": "(;\\[[a-z0-9]+\\])|((☆|●)[a-z0-9]+(☆|●))|(<\\d+>(?!//))|((//[^\n]*\n)(?!<\\d+>))",
"description": "译文开头标签的正则表达式"
},
"dltxt.core.otherPrefixRegex": {
"type": "string",
"default": "",
"description": "其他合法的开头的正则表达式"
},
"dltxt.core.z.skipCharsPrefix": {
"type": "string",
"default": " \t 「『n\\",
"description": "移动至译文开头时可以跳过的字符(用于nextLine等)"
},
"dltxt.core.z.translatedTextSuffixRegex": {
"type": "string",
"default": "」|』|(\\\\@)",
"description": "标识译文结尾的正则表达式(只用于deleteAllAfter)"
},
"dltxt.appearance.showKeywordHighlight": {
"type": "boolean",
"default": true,
"description": "外观:显示关键词高亮"
},
"dltxt.appearance.showErrorHighlight": {
"type": "boolean",
"default": true,
"description": "外观:显示错误"
},
"dltxt.formatter.a.padding": {
"type": "boolean",
"default": true,
"description": "格式化文本:统一缩进与对话外的单括号(「」)"
},
"dltxt.formatter.a.ellipsis.enable": {
"type": "boolean",
"default": true,
"description": "格式化文本:统一省略号"
},
"dltxt.formatter.a.ellipsis.specify": {
"type": "string",
"default": "……",
"description": "格式化文本:省略号统一改为"
},
"dltxt.formatter.a.wave.enable": {
"type": "boolean",
"default": true,
"description": "格式化文本:统一波浪号"
},
"dltxt.formatter.a.wave.specify": {
"type": "string",
"default": "~",
"description": "格式化文本:波浪号统一改为"
},
"dltxt.formatter.a.horizontalLine.enable": {
"type": "boolean",
"default": true,
"description": "格式化文本:统一破折号"
},
"dltxt.formatter.a.horizontalLine.specify": {
"type": "string",
"default": "——",
"description": "格式化文本:破折号统一改为"
},
"dltxt.formatter.b.fixReversedQuote": {
"type": "boolean",
"default": true,
"description": "格式化文本:统一写反的、或半角的单引号、双引号(”a“)"
},
"dltxt.formatter.b.h2fPunc": {
"type": "boolean",
"default": true,
"description": "格式化文本:将常用标点符号统一为中文全角标点(半角引号除外)"
},
"dltxt.formatter.b.h2fAlpha": {
"type": "boolean",
"default": false,
"description": "格式化文本:将英文与数字统一为全角(如果文本中有英文脚本请勿使用)"
},
"dltxt.formatter.c.omitPeriod": {
"type": "boolean",
"default": true,
"description": "格式化文本:去除对话句末的句号"
},
"dltxt.formatter.d.customMapping": {
"type": "object",
"default": {},
"description": "格式化文本:自定义翻译表",
"additionalProperties": {
"type": "string"
}
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile && npm run esbuild-base -- --minify",
"compile": "tsc -p ./",
"lint": "eslint src --ext ts",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"test": "node ./out/test/runTest.js",
"esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node",
"esbuild": "npm run esbuild-base -- --sourcemap",
"esbuild-watch": "npm run esbuild-base -- --sourcemap --watch",
"test-compile": "tsc -p ./"
},
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^7.0.2",
"@types/node": "^13.11.0",
"@types/vscode": "^1.47.0",
"@typescript-eslint/eslint-plugin": "^2.30.0",
"@typescript-eslint/parser": "^2.30.0",
"esbuild": "^0.17.19",
"eslint": "^6.8.0",
"glob": "^7.1.6",
"mocha": "^7.1.2",
"typescript": "^3.8.3",
"vscode-test": "^1.3.0"
},
"dependencies": {
"axios": "^0.19.2",
"open": "^7.4.2",
"request": "^2.88.2"
},
"repository": {
"type": "git",
"url": "https://github.com/jsc723/translation-assistant.git"
}
}