[PublicDecks] Keep the empty and status variants correct across language changes

retranslateUi unconditionally rewrote the empty label to the 'nothing
published' variant, stomping the 'no decks match your filters' choice
rebuildGrid had made, and a visible loading message stayed in the old
language. Let retranslateUi pick the same variant rebuildGrid does and
re-show the status so it retranslates.
This commit is contained in:
Lukas Brübach 2026-09-19 07:48:58 +02:00 committed by GitHub
parent a70f729a57
commit 80ad41ea69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,10 +119,16 @@ void TabPublicDecks::retranslateUi()
{ {
// The username is another user's data, so escape it for the AutoText QLabel. // The username is another user's data, so escape it for the AutoText QLabel.
titleLabel->setText(tr("Public decks of %1").arg(userName.toHtmlEscaped())); titleLabel->setText(tr("Public decks of %1").arg(userName.toHtmlEscaped()));
emptyLabel->setText(tr("This user has not published any decks.")); // The same choice rebuildGrid makes, so a language change does not swap
// the "no match" variant for the "nothing published" one.
emptyLabel->setText(model->totalCount() > 0 ? tr("No decks match your filters.")
: tr("This user has not published any decks."));
refreshButton->setToolTip(tr("Refresh")); refreshButton->setToolTip(tr("Refresh"));
refreshButton->setAccessibleName(tr("Refresh")); refreshButton->setAccessibleName(tr("Refresh"));
quickSettingsWidget->setToolTip(tr("Public Decks Settings")); quickSettingsWidget->setToolTip(tr("Public Decks Settings"));
// Re-show the status so a visible loading message picks up the new language
// instead of staying stale; if nothing is shown it just stays hidden.
updateLoadingState(model->isLoading());
emit tabTextChanged(this, getTabText()); emit tabTextChanged(this, getTabText());
} }