fix: 自定义翻译简体中文统一使用 zh-hans

This commit is contained in:
guoqingshan
2026-08-02 09:02:58 +08:00
parent 3eabdc9f32
commit ffdeb79c0b
4 changed files with 20 additions and 9 deletions
+2 -2
View File
@@ -116,7 +116,7 @@ function translateEditorToEnZh(text) {
}
return Promise.all([
apiTranslate({ text: text, source: 'es', target: 'en' }),
apiTranslate({ text: text, source: 'es', target: 'zh' })
apiTranslate({ text: text, source: 'es', target: 'zh-hans' })
]).then(function(results) {
if (!results[0].translatedText || !results[1].translatedText) {
throw new Error('翻译接口未返回结果');
@@ -397,7 +397,7 @@ function translateZhOnline(zh) {
var seq = ++helperRequestSeq;
var request;
if (shouldUseApiTranslation()) {
request = apiTranslate({ text: zh, source: 'zh', target: 'es' }).then(function(data) {
request = apiTranslate({ text: zh, source: 'zh-hans', target: 'es' }).then(function(data) {
return { translatedText: data.translatedText };
});
} else if (!BACKEND_MODE) {