From 80ad41ea69e2cceab3bda5a42e3d076ed44f26ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sat, 19 Sep 2026 07:48:58 +0200 Subject: [PATCH] [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. --- .../src/interface/widgets/tabs/tab_public_decks.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp b/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp index 16edeecdd..dcab2645c 100644 --- a/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp +++ b/cockatrice/src/interface/widgets/tabs/tab_public_decks.cpp @@ -119,10 +119,16 @@ void TabPublicDecks::retranslateUi() { // The username is another user's data, so escape it for the AutoText QLabel. 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->setAccessibleName(tr("Refresh")); 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()); }