mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2026-05-30 02:42:30 -04:00
Handle empty translation
This commit is contained in:
+2
-2
@@ -81,9 +81,9 @@ def detect_languages(text):
|
||||
def improve_translation_formatting(source, translation, improve_punctuation=True):
|
||||
source = source.strip()
|
||||
|
||||
if not len(source):
|
||||
if not len(source) or not len(translation):
|
||||
return ""
|
||||
|
||||
|
||||
if improve_punctuation:
|
||||
source_last_char = source[len(source) - 1]
|
||||
translation_last_char = translation[len(translation) - 1]
|
||||
|
||||
Reference in New Issue
Block a user