-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
415 lines (415 loc) · 13.5 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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
{
"name": "i18n-extension",
"displayName": "i18n-extension",
"icon": "./assets/icons/i18n.png",
"description": "国际化辅助扩展, 支持 js 、ts、 json 键值对解析 (注意解析类型的时候也会当作键值对), 支持复制国际化键值对文本转国际化代码",
"author": {
"name": "firman-34",
"email": "524915379@qq.com",
"url": "https://github.com/fireMan-34/vscode-plugin-i18n-helper"
},
"bugs": {
"email": "524915379@qq.com",
"url": "https://github.com/fireMan-34/vscode-plugin-i18n-helper/issues"
},
"publisher": "fireMan-34",
"version": "1.0.15",
"engines": {
"vscode": "^1.81.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onLanguage:javascript",
"onLanguage:typescript",
"onLanguage:javascriptreact",
"onLanguage:typescriptreact"
],
"main": "./out/extension.js",
"contributes": {
"configuration": [
{
"title": "国际化扩展插件配置",
"properties": {
"i18n-extension.isOpenCheckDir": {
"type": "boolean",
"default": true,
"description": "是否启动之后检测现有国际化项目是否失效,失效则移除"
},
"i18n-extension.mainLanguage": {
"type": "string",
"enum": [
"ZH_CN",
"ZH_HK",
"EN_US",
"KO_KR",
"JA_JP",
"UN_KNOWN"
],
"enumDescriptions": [
"中文简体",
"中文繁体",
"英文",
"韩文",
"日文",
"未知"
],
"default": "ZH_CN",
"description": "配置当前识别语言"
},
"i18n-extension.scanFolders": {
"type": "array",
"default": [
"locales",
"locale"
],
"description": "支持扫描的国际化目录匹配"
},
"i18n-extension.generateTemplate": {
"description": "配置复制键值对产生的模板文本,目前已加入其它文本渲染场景。请输入 {{id}} {{msg}} 如果有字符串则用单引号的形式。",
"default": "formatMessage({\nid: '{{id}}',\ndefaultMessage: '{{msg}}',\n})",
"anyOf": [
{
"type": "string",
"enum": [
"formatMessage({\nid: '{{id}}',\ndefaultMessage: '{{msg}}',\n})",
"formatMessage({\nid: '{{id}}',\n})",
"intl.formatMessage({\nid: '{{id}}',\ndefaultMessage: '{{msg}}',\n})",
"intl.formatMessage({\nid: '{{id}}',\n})",
"i18n.t('{{id}}')",
"t('{{id}}')",
"$t('{{id}}')"
],
"enumItemLabels": [
"formatMessage 渲染国际化 key&val",
"formatMessage 渲染国际化 key",
"formatMessage 渲染国际化 key&val, 添加 intl 前缀",
"formatMessage 渲染国际化 key, 添加 intl 前缀",
"i18n.t 渲染国际化 key, 添加 intl 前缀",
"t 渲染国际化 key, 添加 intl 前缀"
],
"enumDescriptions": [
"formatMessage({\nid: '{{id}}',\ndefaultMessage: '{{msg}}',\n})",
"formatMessage({\nid: '{{id}}',\n})",
"intl.formatMessage({\nid: '{{id}}',\ndefaultMessage: '{{msg}}',\n})",
"intl.formatMessage({\nid: '{{id}}',\n})",
"i18n.t('{{id}}')",
"t('{{id}}')",
"$t('{{id}}')"
]
},
{
"type": "string"
}
]
},
"i18n-extension.generateTemplates": {
"description": "配置键值对代码的模板文本代码文本,支持自定义模式,具体输入模板后,鼠标悬浮查看对应的提示。",
"type": "array",
"items": {
"oneOf": [
{
"type": "string",
"enum": [
"formatMessage({id: '{{id}}',defaultMessage: '{{msg}}',})",
"formatMessage({id: '{{id}}',})",
"intl.formatMessage({id: '{{id}}',defaultMessage: '{{msg}}',})",
"intl.formatMessage({id: '{{id}}',})",
"i18n.t('{{id}}')",
"t('{{id}}')",
"$t('{{id}}')",
"getMessage('{{id}},{{msg}}')"
],
"enumItemLabels": [
"formatMessage 渲染国际化 key&val",
"formatMessage 渲染国际化 key",
"formatMessage 渲染国际化 key&val, 添加 intl 前缀",
"formatMessage 渲染国际化 key, 添加 intl 前缀",
"i18n.t 渲染国际化 key, 添加 intl 前缀",
"t 渲染国际化 key, 添加 intl 前缀"
],
"enumDescriptions": [
"formatMessage({\nid: '{{id}}',\ndefaultMessage: '{{msg}}',\n})",
"formatMessage({\nid: '{{id}}',\n})",
"intl.formatMessage({\nid: '{{id}}',\ndefaultMessage: '{{msg}}',\n})",
"intl.formatMessage({\nid: '{{id}}',\n})",
"i18n.t('{{id}}')",
"t('{{id}}')",
"$t('{{id}}')"
]
},
{
"default": "formatMessage({id:'{{id}}',defaultMessage: '{{msg}}'},{{variable}})",
"type": "string",
"description": "自定义代码模板,请输入携带 {{id}} {{msg}} {{variable}} 的字符串 如果有字符串则用单引号的形式。{{id}} 必备的,国际化识别键值, {{msg}} 可选,添加匹配对应的默认翻译文本,{{variable}} 无需包裹引号,将会被转换为字面量对象类型,仅在携带国际化嵌入变量的值中才会启用。 "
}
]
}
},
"i18n-extension.fastTranslateLanguageType": {
"type": "array",
"items": {
"enum": [
"ZH_CN",
"ZH_HK",
"EN_US",
"KO_KR",
"JA_JP",
"UN_KNOWN"
],
"enumDescriptions": [
"中文简体",
"中文繁体",
"英文",
"韩文",
"日文",
"未知"
]
},
"default": [
"EN_US"
],
"description": "快速翻译中输出的语言类型"
},
"i18n-extension.translateEngine": {
"type": "string",
"enum": [
"baidu",
"caiYun",
"Google"
],
"enumDescriptions": [
"百度翻译",
"彩云翻译",
"谷歌翻译"
],
"default": "baidu",
"description": "翻译引擎类型"
},
"i18n-extension.generatedCodeFromStrMode": {
"type": "string",
"title": "字符串自动生成国际化代码功能启用模式",
"description": "修改启用模式,避免一些场景强制写入,或者性能浪费。",
"enum": [
"ask",
"silent",
"none"
],
"enumDescriptions": [
"询问模式",
"静默模式",
"罢工模式"
],
"enumItemLabels": [
"询问",
"静默",
"罢工"
],
"default": "ask"
}
}
}
],
"commands": [
{
"command": "i18n.parseKeyAndValue2FormatMessage",
"title": "提取国际化代码"
},
{
"command": "i18n.openWebView",
"title": "打开国际化页面"
},
{
"command": "i18n.scanI18File",
"title": "扫描国际化代码"
},
{
"command": "i18n.i18nRuleDirSet",
"title": "文件规则设定命令"
},
{
"command": "i18n.fastTranslate",
"title": "快速翻译单个文本"
},
{
"command": "i18n.strToi18nCode",
"title": "文本转国际化代码"
},
{
"command": "i18n.selectionToi18nCode",
"title": "选中文本转国际化"
},
{
"command": "i18n.quickSearchI18n",
"title": "快速搜索国际化代码"
}
],
"keybindings": [
{
"command": "i18n.parseKeyAndValue2FormatMessage",
"key": "ctrl+i",
"win": "ctrl+i",
"mac": "cmd+i",
"when": "editorTextFocus"
},
{
"command": "i18n.selectionToi18nCode",
"key": "ctrl+shift+2",
"win": "ctrl+shift+2",
"mac": "ctrl+shift+2",
"when": "editorHasSelection"
},
{
"command": "i18n.quickSearchI18n",
"key": "ctrl+shift+1",
"win": "ctrl+shift+1",
"mac": "ctrl+shift+1",
"when": "editorTextFocus"
}
],
"menus": {
"explorer/context": [
{
"command": "i18n.scanI18File",
"group": "7_modification",
"when": "explorerResourceIsFolder && resourceFilename in i18n.supportedFolders"
}
],
"editor/context": [
{
"command": "i18n.parseKeyAndValue2FormatMessage",
"group": "9_cutcopypaste",
"when": "editorTextFocus && editorHasSelection && i18n.isInI18nDirOne"
},
{
"command": "i18n.quickSearchI18n",
"group": "9_cutcopypaste",
"when": "editorTextFocus"
}
],
"view/item/context": [
{
"command": "i18n.i18nRuleDirSet",
"when": "view =~ /i18n-map/ && viewItem == i18n.dir"
}
],
"editor/context/copy": [
{
"command": "i18n.selectionToi18nCode",
"group": "9_cutcopypaste",
"when": "editorHasSelection"
}
]
},
"snippets": [],
"viewsContainers": {
"activitybar": [
{
"id": "i18n-map-views",
"title": "国际化",
"icon": "./assets/icons/i18nView.svg"
}
]
},
"views": {
"i18n-map-views": [
{
"id": "i18n-map-dir",
"name": "国际化目录",
"contextualTitle": "国际化目录语言类型划分"
},
{
"id": "i18n-map-view",
"name": "国际化文本"
},
{
"id": "i18n-map-config",
"name": "国际化配置",
"type": "webview"
}
]
},
"viewsWelcome": [
{
"view": "i18n-map-config",
"contents": "欢迎使用极简 React 国际化开发助手,如果使用有什么建议或者 bug 可以在 [GitHub issue](https://github.com/fireMan-34/vscode-plugin-i18n-helper/issues) 提,作者水平眼界限制,感谢你的建议。",
"when": "isWindows||isLinux||isMac"
}
]
},
"scripts": {
"vscode:prepublish": "npm run dev:webview && npm run dev",
"compile": "tsc -p ./ && tsc-alias",
"watch": "tsc -watch -p ./",
"lint": "eslint src --ext ts",
"pretest": "npm run compile && npm run lint",
"test": "npm run test:unit && npm run test:suit",
"test:suit": "node ./out/test/runTest.js",
"test:unit": "mocha ./src/test/unit/index.ts",
"ri": "rimraf ./node_modules && npm install",
"package": "vsce package",
"publish": "vsce publish",
"dev:webview": "webpack --config ./client/webpack.config.js",
"dev": "webpack --config ./webpack.config.js",
"prepare": "husky install",
"commit:talk": "pwsh ./scripts/commitTalk.ps1",
"version": "npm run commit:talk",
"preversion": "pwsh ./scripts/preVersion.ps1",
"simpleMockSever": "ts-node ./mock/mock.simple.server.ts"
},
"devDependencies": {
"@types/chai": "^4.3.11",
"@types/glob": "^8.1.0",
"@types/lodash": "^4.14.197",
"@types/mocha": "^10.0.1",
"@types/node": "16.11.7",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
"@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"@vscode/test-electron": "^2.3.2",
"@vscode/vsce": "^2.21.0",
"autoprefixer": "^10.4.15",
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"eslint": "^8.41.0",
"glob": "^8.1.0",
"html-webpack-plugin": "^5.5.3",
"husky": "^8.0.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"postcss": "^8.4.29",
"postcss-loader": "^7.3.3",
"rimraf": "^5.0.1",
"style-loader": "^3.3.3",
"tailwindcss": "^3.3.3",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"ts-node-dev": "^2.0.0",
"tsc-alias": "^1.8.7",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"axios": "^1.6.1",
"chai": "^4.3.10",
"chinese-conv": "^1.0.1",
"clipboardy": "^2.0.0",
"lodash": "^4.17.21",
"prettier": "^3.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"ts-morph": "^21.0.1"
},
"repository": {
"type": "git",
"url": "https://github.com/fireMan-34/vscode-plugin-i18n-helper"
},
"license": "Apache-2.0"
}