Skip to content

Commit

Permalink
fix(Translate.response): XML
Browse files Browse the repository at this point in the history
Update Translate.response.dev.js
Update Translate.response.js
Update CHANGELOG.md
  • Loading branch information
VirgilClyne committed Oct 31, 2024
1 parent b43befd commit aaf07c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
### 🆕 New Features
* `翻译器`允许通过`参数面板`传入任意`语言代码`
* 传入的`语言代码`如不受`翻译API`支持,则可能导致翻译失败,请先查阅各`翻译API``支持语言列表`进行确认
* 例如:当使用`微软翻译`时,在`参数面板``Language[1]`填入`lzh`,可以将翻译语言设置为`中文(文言文)`
### 🛠️ Bug Fixes
* 修复 `YouTube``timedText` 格式`翻译字幕`生成错误
4 changes: 1 addition & 3 deletions src/Translate.response.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ log(`⚠ FORMAT: ${FORMAT}`, "");
para.s = undefined;
};
const span = para?.span ?? para;
if (Array.isArray(span)) sentences = span?.map(span => span?.["#"] ?? "\u200b").join(breakLine);
else sentences = span?.["#"];
if (Array.isArray(sentences)) sentences = sentences.join(" ");
const sentences = (Array.isArray(span)) ? span?.map(span => span?.["#"] ?? "\u200b").join(breakLine) : span?.["#"];
fullText.push(sentences ?? "\u200b");
/*
const spans = para?.span ?? para?.s ?? para;
Expand Down
4 changes: 1 addition & 3 deletions src/Translate.response.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ log(`⚠ FORMAT: ${FORMAT}`, "");
para.s = undefined;
};
const span = para?.span ?? para;
if (Array.isArray(span)) sentences = span?.map(span => span?.["#"] ?? "\u200b").join(breakLine);
else sentences = span?.["#"];
if (Array.isArray(sentences)) sentences = sentences.join(" ");
const sentences = (Array.isArray(span)) ? span?.map(span => span?.["#"] ?? "\u200b").join(breakLine) : span?.["#"];
fullText.push(sentences ?? "\u200b");
return para;
});
Expand Down

0 comments on commit aaf07c9

Please sign in to comment.