From 27d7e456cd936b7207821b59d14cb722f680bc2e Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 26 Oct 2023 03:03:38 +0000 Subject: [PATCH] fix: targetLang is `xx-yy` or `xx_yy` --- packages/backend/src/server/api/endpoints/notes/translate.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/backend/src/server/api/endpoints/notes/translate.ts b/packages/backend/src/server/api/endpoints/notes/translate.ts index 1e90fb617..d46a81934 100644 --- a/packages/backend/src/server/api/endpoints/notes/translate.ts +++ b/packages/backend/src/server/api/endpoints/notes/translate.ts @@ -64,6 +64,7 @@ export default define(meta, paramDef, async (ps, user) => { let targetLang = ps.targetLang; if (targetLang.includes("-")) targetLang = targetLang.split("-")[0]; + if (targetLang.includes("_")) targetLang = targetLang.split("_")[0]; if (instance.libreTranslateApiUrl != null) { const jsonBody = {