mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[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:
parent
a70f729a57
commit
80ad41ea69
1 changed files with 7 additions and 1 deletions
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue