Merge pull request #539 from kthchew/fix/translation-switch
Fix untranslated strings after changing language
This commit is contained in:
commit
6d78ea5a45
@ -238,6 +238,9 @@ public:
|
|||||||
TranslatedAction actionREDDIT;
|
TranslatedAction actionREDDIT;
|
||||||
TranslatedAction actionAbout;
|
TranslatedAction actionAbout;
|
||||||
|
|
||||||
|
TranslatedAction actionNoAccountsAdded;
|
||||||
|
TranslatedAction actionNoDefaultAccount;
|
||||||
|
|
||||||
QVector<TranslatedToolButton *> all_toolbuttons;
|
QVector<TranslatedToolButton *> all_toolbuttons;
|
||||||
|
|
||||||
QWidget *centralWidget = nullptr;
|
QWidget *centralWidget = nullptr;
|
||||||
@ -828,7 +831,7 @@ public:
|
|||||||
QMetaObject::connectSlotsByName(MainWindow);
|
QMetaObject::connectSlotsByName(MainWindow);
|
||||||
} // setupUi
|
} // setupUi
|
||||||
|
|
||||||
void retranslateUi(QMainWindow *MainWindow)
|
void retranslateUi(MainWindow *MainWindow)
|
||||||
{
|
{
|
||||||
QString winTitle = tr("%1 - Version %2", "Launcher - Version X").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString());
|
QString winTitle = tr("%1 - Version %2", "Launcher - Version X").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString());
|
||||||
MainWindow->setWindowTitle(winTitle);
|
MainWindow->setWindowTitle(winTitle);
|
||||||
@ -848,6 +851,12 @@ public:
|
|||||||
// submenu buttons
|
// submenu buttons
|
||||||
foldersMenuButton->setText(tr("Folders"));
|
foldersMenuButton->setText(tr("Folders"));
|
||||||
helpMenuButton->setText(tr("Help"));
|
helpMenuButton->setText(tr("Help"));
|
||||||
|
|
||||||
|
// playtime counter
|
||||||
|
if (MainWindow->m_statusCenter)
|
||||||
|
{
|
||||||
|
MainWindow->updateStatusCenter();
|
||||||
|
}
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1254,10 +1263,14 @@ void MainWindow::repopulateAccountsMenu()
|
|||||||
|
|
||||||
if (accounts->count() <= 0)
|
if (accounts->count() <= 0)
|
||||||
{
|
{
|
||||||
QAction *action = new QAction(tr("No accounts added!"), this);
|
ui->all_actions.removeAll(&ui->actionNoAccountsAdded);
|
||||||
action->setEnabled(false);
|
ui->actionNoAccountsAdded = TranslatedAction(this);
|
||||||
accountMenu->addAction(action);
|
ui->actionNoAccountsAdded->setObjectName(QStringLiteral("actionNoAccountsAdded"));
|
||||||
ui->profileMenu->addAction(action);
|
ui->actionNoAccountsAdded.setTextId(QT_TRANSLATE_NOOP("MainWindow", "No accounts added!"));
|
||||||
|
ui->actionNoAccountsAdded->setEnabled(false);
|
||||||
|
accountMenu->addAction(ui->actionNoAccountsAdded);
|
||||||
|
ui->profileMenu->addAction(ui->actionNoAccountsAdded);
|
||||||
|
ui->all_actions.append(&ui->actionNoAccountsAdded);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1297,18 +1310,23 @@ void MainWindow::repopulateAccountsMenu()
|
|||||||
accountMenu->addSeparator();
|
accountMenu->addSeparator();
|
||||||
ui->profileMenu->addSeparator();
|
ui->profileMenu->addSeparator();
|
||||||
|
|
||||||
QAction *action = new QAction(tr("No Default Account"), this);
|
ui->all_actions.removeAll(&ui->actionNoDefaultAccount);
|
||||||
action->setCheckable(true);
|
ui->actionNoDefaultAccount = TranslatedAction(this);
|
||||||
action->setIcon(APPLICATION->getThemedIcon("noaccount"));
|
ui->actionNoDefaultAccount->setObjectName(QStringLiteral("actionNoDefaultAccount"));
|
||||||
action->setData(-1);
|
ui->actionNoDefaultAccount.setTextId(QT_TRANSLATE_NOOP("MainWindow", "No Default Account"));
|
||||||
action->setShortcut(QKeySequence(tr("Ctrl+0")));
|
ui->actionNoDefaultAccount->setCheckable(true);
|
||||||
|
ui->actionNoDefaultAccount->setIcon(APPLICATION->getThemedIcon("noaccount"));
|
||||||
|
ui->actionNoDefaultAccount->setData(-1);
|
||||||
|
ui->actionNoDefaultAccount->setShortcut(QKeySequence(tr("Ctrl+0")));
|
||||||
if (!defaultAccount) {
|
if (!defaultAccount) {
|
||||||
action->setChecked(true);
|
ui->actionNoDefaultAccount->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
accountMenu->addAction(action);
|
accountMenu->addAction(ui->actionNoDefaultAccount);
|
||||||
ui->profileMenu->addAction(action);
|
ui->profileMenu->addAction(ui->actionNoDefaultAccount);
|
||||||
connect(action, SIGNAL(triggered(bool)), SLOT(changeActiveAccount()));
|
connect(ui->actionNoDefaultAccount, SIGNAL(triggered(bool)), SLOT(changeActiveAccount()));
|
||||||
|
ui->all_actions.append(&ui->actionNoDefaultAccount);
|
||||||
|
ui->actionNoDefaultAccount.retranslate();
|
||||||
|
|
||||||
accountMenu->addSeparator();
|
accountMenu->addSeparator();
|
||||||
ui->profileMenu->addSeparator();
|
ui->profileMenu->addSeparator();
|
||||||
|
Loading…
Reference in New Issue
Block a user