fix: apitranslate bug
This commit is contained in:
@@ -309,13 +309,13 @@ export class BilingualSubtitleManager {
|
|||||||
subtitle.isTranslating = true;
|
subtitle.isTranslating = true;
|
||||||
try {
|
try {
|
||||||
const { fromLang, toLang, apiSetting } = this.#setting;
|
const { fromLang, toLang, apiSetting } = this.#setting;
|
||||||
const [translatedText] = await this.#translationService({
|
const { trText } = await this.#translationService({
|
||||||
text: subtitle.text,
|
text: subtitle.text,
|
||||||
fromLang,
|
fromLang,
|
||||||
toLang,
|
toLang,
|
||||||
apiSetting,
|
apiSetting,
|
||||||
});
|
});
|
||||||
subtitle.translation = translatedText;
|
subtitle.translation = trText;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.info("Translation failed for:", subtitle.text, error);
|
logger.info("Translation failed for:", subtitle.text, error);
|
||||||
subtitle.translation = "[Translation failed]";
|
subtitle.translation = "[Translation failed]";
|
||||||
|
|||||||
Reference in New Issue
Block a user