From f807ac2a81fcd4baa72cc5acb340b8496f39aa6f Mon Sep 17 00:00:00 2001 From: Abdo Date: Mon, 1 Jan 2024 07:20:31 +0300 Subject: [PATCH] Use our translation of 'Discard' (#2920) * Use our translation of 'Discard' * Update qt/aqt/utils.py (dae) --- ftl/core/actions.ftl | 1 + qt/aqt/utils.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ftl/core/actions.ftl b/ftl/core/actions.ftl index 56086f484..c855f9d46 100644 --- a/ftl/core/actions.ftl +++ b/ftl/core/actions.ftl @@ -4,6 +4,7 @@ actions-any-selected = Any selected actions-cancel = Cancel actions-choose = Choose actions-close = Close +actions-discard = Discard actions-copy = Copy actions-create-copy = Create Copy actions-custom-study = Custom Study diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 27713a8e7..a2b5532d4 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -164,6 +164,9 @@ class MessageBox(QMessageBox): b = self.addButton(button, QMessageBox.ButtonRole.ActionRole) elif isinstance(button, QMessageBox.StandardButton): b = self.addButton(button) + # a translator has complained the default Qt translation is inappropriate, so we override it + if button == QMessageBox.StandardButton.Discard: + b.setText(tr.actions_discard()) elif isinstance(button, tuple): b = self.addButton(button[0], button[1]) else: