From 071bdeca0d294f2cbec66ccd2d448eb1be38ed8d Mon Sep 17 00:00:00 2001 From: vlOd <66838724+vlOd2@users.noreply.github.com> Date: Sat, 27 Dec 2025 01:21:29 +0200 Subject: [PATCH 1/2] Update src/stores/player/utils/captionstranslation.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/stores/player/utils/captionstranslation.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stores/player/utils/captionstranslation.ts b/src/stores/player/utils/captionstranslation.ts index da95699b..aa0613cc 100644 --- a/src/stores/player/utils/captionstranslation.ts +++ b/src/stores/player/utils/captionstranslation.ts @@ -108,18 +108,18 @@ async function translateCaptions( const successCount = results.filter((v) => v).length; const failedCount = results.length - successCount; - const successPercentange = (successCount / results.length) * 100; - const failedPercentange = (failedCount / results.length) * 100; + const successPercentage = (successCount / results.length) * 100; + const failedPercentage = (failedCount / results.length) * 100; // console.log( // "Done translating captions", // results.length, // successCount, // failedCount, - // successPercentange, - // failedPercentange, + // successPercentage, + // failedPercentage, // ); - if (failedPercentange > successPercentange) { + if (failedPercentage > successPercentage) { throw new Error("Success percentage is not acceptable"); } } catch (error) { From bdf5cba98ba05e22f3ada29df046b9225e7c7d44 Mon Sep 17 00:00:00 2001 From: vlOd <66838724+vlOd2@users.noreply.github.com> Date: Sat, 27 Dec 2025 01:21:40 +0200 Subject: [PATCH 2/2] Update src/stores/player/utils/captionstranslation.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/stores/player/utils/captionstranslation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stores/player/utils/captionstranslation.ts b/src/stores/player/utils/captionstranslation.ts index aa0613cc..b65913cc 100644 --- a/src/stores/player/utils/captionstranslation.ts +++ b/src/stores/player/utils/captionstranslation.ts @@ -76,11 +76,11 @@ async function translateCaption( for (let i = 0; i < RETRY_COUNT; i += 1) { try { text = await translateText( - caption.text.replace("\n", "
"), + caption.text.replaceAll("\n", "
"), targetLang, ); if (text) { - text = text.replace("
", "\n"); + text = text.replaceAll("
", "\n"); break; } } catch (error) {