Skip to content

Commit

Permalink
Merge pull request #681 from Francoo86/fixes
Browse files Browse the repository at this point in the history
lang parameter inconsistency fix
  • Loading branch information
zyddnys authored Aug 20, 2024
2 parents d93e456 + dfcf063 commit 94a411e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manga_translator/server/ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ <h1 class="text-center text-lg font-light">Image/Manga Translator</h1>
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)
Expand Down
4 changes: 2 additions & 2 deletions manga_translator/server/web_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,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'
Expand Down

0 comments on commit 94a411e

Please sign in to comment.