Use our translation of 'Discard' (#2920)

* Use our translation of 'Discard'

* Update qt/aqt/utils.py (dae)
This commit is contained in:
Abdo 2024-01-01 07:20:31 +03:00 committed by GitHub
parent f544bdd041
commit dbfb46e6c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -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

View file

@ -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: