diff --git a/news.d/bugfix/1219.ui.md b/news.d/bugfix/1219.ui.md deleted file mode 100644 index 0bb1ff2a7..000000000 --- a/news.d/bugfix/1219.ui.md +++ /dev/null @@ -1 +0,0 @@ -Improve updating a translation in the dictionary editor: don't delete the key first, so extra metadata (e.g. additional columns in an Excel dictionary) is not deleted. diff --git a/plover/gui_qt/dictionary_editor.py b/plover/gui_qt/dictionary_editor.py index 8830bf77d..bd8d531be 100644 --- a/plover/gui_qt/dictionary_editor.py +++ b/plover/gui_qt/dictionary_editor.py @@ -224,11 +224,10 @@ def setData(self, index, value, role=Qt.EditRole, record=True): break if dictionary == old_item.dictionary: return False - if (old_item.dictionary, old_item.strokes) != (dictionary, strokes): - try: - del old_item.dictionary[old_item.strokes] - except KeyError: - pass + try: + del old_item.dictionary[old_item.strokes] + except KeyError: + pass if not old_item.strokes and not old_item.translation: # Merge operations when editing a newly added row. if self._operations and self._operations[-1] == [(None, old_item)]: