forked from mirrors/LibreTranslate
restore formatting only if transliteration dont fail
This commit is contained in:
parent
077d6e9efa
commit
c66a519751
1 changed files with 2 additions and 2 deletions
|
@ -129,12 +129,12 @@ def __transliterate_line(transliterator, line_text):
|
|||
# the actual transliteration of the word
|
||||
t_word = transliterator.transliterate(orig_word.strip(string.punctuation))
|
||||
|
||||
t_word = improve_translation_formatting(orig_word.strip(string.punctuation), t_word, improve_punctuation=False)
|
||||
|
||||
# if transliteration fails, default back to the original word
|
||||
if not t_word:
|
||||
t_word = orig_word
|
||||
else:
|
||||
t_word = improve_translation_formatting(orig_word.strip(string.punctuation), t_word, improve_punctuation=False)
|
||||
|
||||
# add back any stripped punctuation
|
||||
if r_diff:
|
||||
t_word = t_word + "".join(r_diff)
|
||||
|
|
Loading…
Reference in a new issue