From 27aeca9c2d0291604f9b5375e6d2adc9841b758c Mon Sep 17 00:00:00 2001 From: naskya Date: Wed, 3 Jan 2024 07:14:37 +0900 Subject: [PATCH] fix: unable to translate texts into English Language code 'en' is deprecated in the DeepL API --- packages/backend/src/misc/translate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/misc/translate.ts b/packages/backend/src/misc/translate.ts index e0a75bbc..07f5ff2b 100644 --- a/packages/backend/src/misc/translate.ts +++ b/packages/backend/src/misc/translate.ts @@ -78,7 +78,7 @@ export default async function ( const result = await deeplTranslator.translateText( text, source as deepl.SourceLanguageCode | null, - target as deepl.TargetLanguageCode, + (target === "en" ? to : target) as deepl.TargetLanguageCode, ); return {