Skip to content

Commit

Permalink
Merge pull request #199 from WeibingChen17/patch-1
Browse files Browse the repository at this point in the history
Fix an issue when content_to_trans is empty
  • Loading branch information
BingLingGroup authored Dec 21, 2023
2 parents bd32a8e + f92354a commit c40a608
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autosub/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,10 @@ def list_to_googletrans( # pylint: disable=too-many-locals, too-many-arguments,

if translator != ManualTranslator and src_language == "auto":
content_to_trans = '\n'.join(text_list[i:partial_index[0]])
result_src = translator.detect(content_to_trans).lang
if len(content_to_trans) > 0:
result_src = translator.detect(content_to_trans).lang
else:
result_src = ""
else:
result_src = src_language

Expand Down

0 comments on commit c40a608

Please sign in to comment.