Skip to content

Commit

Permalink
Don't treat blank line as translation
Browse files Browse the repository at this point in the history
... if the line was already blank
  • Loading branch information
machinewrapped committed Jun 2, 2024
1 parent 5509014 commit 257494f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions GUI/Widgets/ContentView.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def _edit_line(self, item : LineItem):
if dialog.model:
original_text = dialog.model.get('original')
translated_text = dialog.model.get('translated')
if not translated_text and not dialog.model.get('was_translated'):
translated_text = None

self.gui.PerformModelAction('Update Line', (item.number, original_text, translated_text,))

Expand Down
3 changes: 2 additions & 1 deletion GUI/Widgets/Editors.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ def __init__(self, line : LineItem, parent=None) -> None:
self.line = line
self.model = {
'original' : self.line.text if line else "",
'translated' : self.line.translation_text if line else ""
'translated' : self.line.translation_text if line else "",
'was_translated' : bool(self.line.translation_text)
}
super().__init__(self.model, parent, title=f"Line {self.line.number}: {self.line.start} --> {self.line.end}")

Expand Down

0 comments on commit 257494f

Please sign in to comment.