Extend /languages to include targets

This commit is contained in:
Piero Toffanin 2022-12-09 16:36:12 -05:00
parent 0478d4ee2c
commit e79089b5c1
3 changed files with 10 additions and 13 deletions

View file

@ -81,9 +81,12 @@ def detect_languages(text):
def improve_translation_formatting(source, translation, improve_punctuation=True):
source = source.strip()
if not len(source) or not len(translation):
if not len(source):
return ""
if not len(translation):
return source
if improve_punctuation:
source_last_char = source[len(source) - 1]
translation_last_char = translation[len(translation) - 1]