fix: 自定义翻译简体中文统一使用 zh-hans
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user