mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-24 08:51:00 +00:00
Fix 400 error msg
This commit is contained in:
parent
039f878f7f
commit
6f293f6013
1 changed files with 1 additions and 1 deletions
|
@ -858,7 +858,7 @@ def create_app(args):
|
||||||
detected_src_lang = candidate_langs[0]
|
detected_src_lang = candidate_langs[0]
|
||||||
src_lang = next(iter([l for l in languages if l.code == detected_src_lang["language"]]), None)
|
src_lang = next(iter([l for l in languages if l.code == detected_src_lang["language"]]), None)
|
||||||
if src_lang is 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_file_path = argostranslatefiles.translate_file(src_lang.get_translation(tgt_lang), filepath)
|
||||||
translated_filename = os.path.basename(translated_file_path)
|
translated_filename = os.path.basename(translated_file_path)
|
||||||
|
|
Loading…
Reference in a new issue