From a925e22ce41cb99555313b0cb83e3731a7cb096c Mon Sep 17 00:00:00 2001
From: Franco <115720207+Francoo86@users.noreply.github.com>
Date: Wed, 24 Jul 2024 16:19:53 -0400
Subject: [PATCH 1/2] target_lang form fix
---
manga_translator/server/ui.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manga_translator/server/ui.html b/manga_translator/server/ui.html
index 2e6d4fb6..88dcb9fc 100644
--- a/manga_translator/server/ui.html
+++ b/manga_translator/server/ui.html
@@ -292,7 +292,7 @@
Image/Manga Translator
formData.append('detector', this.textDetector)
formData.append('direction', this.renderTextDirection)
formData.append('translator', this.translator)
- formData.append('tgt_lang', this.targetLanguage)
+ formData.append('target_lang', this.targetLanguage)
const xhr = new XMLHttpRequest()
xhr.open('POST', `${BASE_URI}submit`, true)
From dfcf0636e1d41668e2706d9d62c67b04bd0788fe Mon Sep 17 00:00:00 2001
From: Franco <115720207+Francoo86@users.noreply.github.com>
Date: Wed, 24 Jul 2024 16:21:21 -0400
Subject: [PATCH 2/2] target_lang inconsistency fix
---
manga_translator/server/web_main.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/manga_translator/server/web_main.py b/manga_translator/server/web_main.py
index b7be9a3a..fed6d800 100644
--- a/manga_translator/server/web_main.py
+++ b/manga_translator/server/web_main.py
@@ -150,8 +150,8 @@ async def handle_post(request):
target_language = 'CHS'
detector = 'default'
direction = 'auto'
- if 'tgt_lang' in data:
- target_language = data['tgt_lang'].upper()
+ if 'target_lang' in data:
+ target_language = data['target_lang'].upper()
# TODO: move dicts to their own files to reduce load time
if target_language not in VALID_LANGUAGES:
target_language = 'CHS'