daodou-command 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +13 -0
- package/.idea/workspace.xml +30 -29
- package/CHANGELOG.md +21 -1
- package/lib/commands/lang.js +0 -2
- package/lib/translation/TranslationService.js +0 -19
- package/lib/translation/engines/ali/AliTranslator.js +1 -0
- package/lib/translation/engines/baidu/BaiduTranslator.js +1 -0
- package/lib/translation/engines/deepl/DeeplTranslator.js +1 -0
- package/lib/translation/engines/google/GoogleTranslator.js +1 -0
- package/lib/translation/engines/microsoft/MicrosoftTranslator.js +1 -0
- package/lib/translation/engines/openai/OpenaiTranslator.js +2 -1
- package/lib/translation/engines/youdao/YoudaoTranslator.js +1 -0
- package/lib/utils/translation.js +0 -18
- package/package.json +1 -1
package/.idea/workspace.xml
CHANGED
|
@@ -13,45 +13,45 @@
|
|
|
13
13
|
<component name="Git.Settings">
|
|
14
14
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
15
15
|
</component>
|
|
16
|
-
<component name="GitHubPullRequestSearchHistory"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
<component name="GitHubPullRequestSearchHistory">{
|
|
17
|
+
"lastFilter": {
|
|
18
|
+
"state": "OPEN",
|
|
19
|
+
"assignee": "h025"
|
|
20
20
|
}
|
|
21
|
-
}
|
|
22
|
-
<component name="GithubPullRequestsUISettings"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
}</component>
|
|
22
|
+
<component name="GithubPullRequestsUISettings">{
|
|
23
|
+
"selectedUrlAndAccountId": {
|
|
24
|
+
"url": "https://github.com/h025/daodou-command.git",
|
|
25
|
+
"accountId": "c8b4f74c-2e36-4aad-b608-940f73fc88db"
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
|
-
<component name="ProjectColorInfo"
|
|
29
|
-
|
|
30
|
-
}
|
|
27
|
+
}</component>
|
|
28
|
+
<component name="ProjectColorInfo">{
|
|
29
|
+
"associatedIndex": 6
|
|
30
|
+
}</component>
|
|
31
31
|
<component name="ProjectId" id="33EP70DuHXVnueD9LcTKpn8t7Vr" />
|
|
32
32
|
<component name="ProjectViewState">
|
|
33
33
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
34
34
|
<option name="showLibraryContents" value="true" />
|
|
35
35
|
</component>
|
|
36
|
-
<component name="PropertiesComponent"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
<component name="PropertiesComponent">{
|
|
37
|
+
"keyToString": {
|
|
38
|
+
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
|
39
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
40
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
41
|
+
"git-widget-placeholder": "main",
|
|
42
|
+
"last_opened_file_path": "/Users/summermr/daodou/daodou-command",
|
|
43
|
+
"node.js.detected.package.eslint": "true",
|
|
44
|
+
"node.js.detected.package.tslint": "true",
|
|
45
|
+
"node.js.selected.package.eslint": "(autodetect)",
|
|
46
|
+
"node.js.selected.package.tslint": "(autodetect)",
|
|
47
|
+
"nodejs_package_manager_path": "npm",
|
|
48
|
+
"vue.rearranger.settings.migration": "true"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}</component>
|
|
51
51
|
<component name="SharedIndexes">
|
|
52
52
|
<attachedChunks>
|
|
53
53
|
<set>
|
|
54
|
-
<option value="bundled-js-predefined-d6986cc7102b-
|
|
54
|
+
<option value="bundled-js-predefined-d6986cc7102b-3aa1da707db6-JavaScript-WS-252.27397.92" />
|
|
55
55
|
</set>
|
|
56
56
|
</attachedChunks>
|
|
57
57
|
</component>
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
<option name="number" value="Default" />
|
|
63
63
|
<option name="presentableId" value="Default" />
|
|
64
64
|
<updated>1758879086844</updated>
|
|
65
|
-
<workItem from="1758879088110" duration="
|
|
65
|
+
<workItem from="1758879088110" duration="1336000" />
|
|
66
|
+
<workItem from="1763003382850" duration="1926000" />
|
|
66
67
|
</task>
|
|
67
68
|
<servers />
|
|
68
69
|
</component>
|
package/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,27 @@
|
|
|
5
5
|
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
|
|
6
6
|
并且此项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
## [1.4.3] - 2025-11-13
|
|
10
|
+
|
|
11
|
+
### 修复
|
|
12
|
+
- 修复语言代码映射问题,正确识别 `tw` 为繁体中文(台湾)
|
|
13
|
+
- 明确 `zh` 语言代码映射为简体中文
|
|
14
|
+
- 更新所有7个翻译引擎的语言代码映射规则:
|
|
15
|
+
- Microsoft Translator: `tw` -> `zh-Hant` (繁体中文)
|
|
16
|
+
- Google Translator: `tw` -> `zh-tw` (繁体中文)
|
|
17
|
+
- Baidu Translator: `tw` -> `cht` (繁体中文)
|
|
18
|
+
- Ali Translator: `tw` -> `zh` (中文)
|
|
19
|
+
- Youdao Translator: `tw` -> `zh-CHT` (繁体中文)
|
|
20
|
+
- DeepL Translator: `tw` -> `ZH` (中文)
|
|
21
|
+
- OpenAI Translator: `tw` -> `繁体中文`,`zh` -> `简体中文`
|
|
22
|
+
|
|
23
|
+
## [1.4.2] - 2025-09-26
|
|
24
|
+
|
|
25
|
+
### 修复
|
|
26
|
+
- 清理代理功能相关代码,移除已废弃的代理统计信息输出
|
|
27
|
+
|
|
28
|
+
## [1.4.1] - 2025-09-26
|
|
9
29
|
|
|
10
30
|
### 修复
|
|
11
31
|
- 移除翻译服务初始化时的冗余输出信息,提升用户体验
|
package/lib/commands/lang.js
CHANGED
|
@@ -150,8 +150,6 @@ class LangCommand {
|
|
|
150
150
|
console.log(chalk.yellow(` ⏭️ 跳过: ${skipCount} 个语言`));
|
|
151
151
|
console.log(chalk.red(` ❌ 失败: ${failCount} 个语言`));
|
|
152
152
|
|
|
153
|
-
// 显示代理统计信息
|
|
154
|
-
this.translationService.showProxyStats();
|
|
155
153
|
|
|
156
154
|
console.log(chalk.blue('\n📋 翻译结果汇总:'));
|
|
157
155
|
console.log(chalk.gray(`原文: "${finalValue}"`));
|
|
@@ -184,25 +184,6 @@ class TranslationService {
|
|
|
184
184
|
return status.sort((a, b) => a.priority - b.priority);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
/**
|
|
188
|
-
* 获取代理统计信息(已禁用)
|
|
189
|
-
* @returns {object} 代理统计信息
|
|
190
|
-
*/
|
|
191
|
-
getProxyStats() {
|
|
192
|
-
return {
|
|
193
|
-
totalProxies: 0,
|
|
194
|
-
currentIndex: 0,
|
|
195
|
-
hasProxies: false,
|
|
196
|
-
message: '代理功能已禁用,直接使用微软翻译'
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 重置代理列表(已禁用)
|
|
202
|
-
*/
|
|
203
|
-
async resetProxies() {
|
|
204
|
-
console.log(chalk.yellow('代理功能已禁用,直接使用微软翻译'));
|
|
205
|
-
}
|
|
206
187
|
}
|
|
207
188
|
|
|
208
189
|
module.exports = TranslationService;
|
|
@@ -137,6 +137,7 @@ class MicrosoftTranslator extends BaseTranslator {
|
|
|
137
137
|
'zh': LANG_CODES.CHINESE_SIMPLIFIED,
|
|
138
138
|
'zh-CN': LANG_CODES.CHINESE_SIMPLIFIED,
|
|
139
139
|
'zh-TW': LANG_CODES.CHINESE_TRADITIONAL,
|
|
140
|
+
'tw': LANG_CODES.CHINESE_TRADITIONAL,
|
|
140
141
|
'en': LANG_CODES.ENGLISH,
|
|
141
142
|
'ja': LANG_CODES.JAPANESE,
|
|
142
143
|
'ko': LANG_CODES.KOREAN,
|
package/lib/utils/translation.js
CHANGED
|
@@ -114,24 +114,6 @@ class TranslationService {
|
|
|
114
114
|
return languageNames[langCode] || langCode.toUpperCase();
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/**
|
|
118
|
-
* 获取代理统计信息
|
|
119
|
-
* @returns {Object} 统计信息
|
|
120
|
-
*/
|
|
121
|
-
getProxyStats() {
|
|
122
|
-
return this.translationService.getProxyStats();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* 显示代理统计信息
|
|
127
|
-
*/
|
|
128
|
-
showProxyStats() {
|
|
129
|
-
const stats = this.getProxyStats();
|
|
130
|
-
console.log(chalk.blue('\n📊 代理服务器统计:'));
|
|
131
|
-
console.log(chalk.gray(` 总代理数: ${stats.totalProxies}`));
|
|
132
|
-
console.log(chalk.gray(` 当前索引: ${stats.currentIndex}`));
|
|
133
|
-
console.log(chalk.gray(` 有代理: ${stats.hasProxies ? '是' : '否'}`));
|
|
134
|
-
}
|
|
135
117
|
|
|
136
118
|
/**
|
|
137
119
|
* 获取引擎状态
|