Add title for some dialogs and avoid hardcoding the text of the discard changes dialog (#3846)

* feat: add title to rename dialog

* fix: localize hardcoded message

* feat: add title to create deck dialog

* refactor: formatting fixes

* add name to about screen

adding my name to contributors for the third time
This commit is contained in:
Brayan Oliveira 2025-03-10 05:53:43 -03:00 committed by GitHub
parent d8460d354a
commit 94e90dbf85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 4 deletions

View file

@ -98,7 +98,7 @@ gnnoh <gerongfenh@gmail.com>
Sachin Govind <sachin.govind.too@gmail.com> Sachin Govind <sachin.govind.too@gmail.com>
Bruce Harris <github.com/bruceharris> Bruce Harris <github.com/bruceharris>
Patric Cunha <patricc@agap2.pt> Patric Cunha <patricc@agap2.pt>
Brayan Oliveira <github.com/brayandso> Brayan Oliveira <69634269+BrayanDSO@users.noreply.github.com>
Luka Warren <github.com/lukawarren> Luka Warren <github.com/lukawarren>
wisherhxl <wisherhxl@gmail.com> wisherhxl <wisherhxl@gmail.com>
dobefore <1432338032@qq.com> dobefore <1432338032@qq.com>

View file

@ -215,6 +215,7 @@ def show(mw: aqt.AnkiQt) -> QDialog:
"Danika_Dakika", "Danika_Dakika",
"Marcelo Vasconcelos", "Marcelo Vasconcelos",
"Mumtaz Hajjo Alrifai", "Mumtaz Hajjo Alrifai",
"Brayan Oliveira",
) )
) )

View file

@ -328,7 +328,9 @@ class DeckBrowser:
def _rename(self, did: DeckId) -> None: def _rename(self, did: DeckId) -> None:
def prompt(name: str) -> None: def prompt(name: str) -> None:
new_name = getOnlyText(tr.decks_new_deck_name(), default=name) new_name = getOnlyText(
tr.decks_new_deck_name(), default=name, title=tr.actions_rename()
)
if not new_name or new_name == name: if not new_name or new_name == name:
return return
else: else:

View file

@ -288,7 +288,7 @@ class FieldDialog(QDialog):
self.webview = None self.webview = None
if self.change_tracker.changed(): if self.change_tracker.changed():
if not askUser("Discard changes?"): if not askUser(tr.card_templates_discard_changes()):
return return
QDialog.reject(self) QDialog.reject(self)

View file

@ -59,7 +59,10 @@ def add_deck_dialog(
default_text: str = "", default_text: str = "",
) -> CollectionOp[OpChangesWithId] | None: ) -> CollectionOp[OpChangesWithId] | None:
if name := getOnlyText( if name := getOnlyText(
tr.decks_new_deck_name(), default=default_text, parent=parent tr.decks_new_deck_name(),
default=default_text,
parent=parent,
title=tr.decks_create_deck(),
).strip(): ).strip():
return add_deck(parent=parent, name=name) return add_deck(parent=parent, name=name)
else: else: