mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-12-18 08:27:03 +02:00
Fix 400 error msg
This commit is contained in:
parent
039f878f7f
commit
6f293f6013
@ -858,7 +858,7 @@ def create_app(args):
|
||||
detected_src_lang = candidate_langs[0]
|
||||
src_lang = next(iter([l for l in languages if l.code == detected_src_lang["language"]]), None)
|
||||
if src_lang is None:
|
||||
abort(400, description=_("%(lang)s is not supported", lang=candidate_langs[0]))
|
||||
abort(400, description=_("%(lang)s is not supported", lang=detected_src_lang["language"]))
|
||||
|
||||
translated_file_path = argostranslatefiles.translate_file(src_lang.get_translation(tgt_lang), filepath)
|
||||
translated_filename = os.path.basename(translated_file_path)
|
||||
|
Loading…
Reference in New Issue
Block a user