GH-3719 Translate some missing strings when changing locale

This commit is contained in:
Jamie Mansfield 2021-06-19 00:12:54 +01:00
parent e148cfbbfd
commit c92b44e6d6
No known key found for this signature in database
GPG Key ID: 36F61598F39F67B0
2 changed files with 18 additions and 2 deletions

View File

@ -738,7 +738,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
repopulateAccountsMenu();
accountMenuButton = new QToolButton(this);
accountMenuButton->setText(tr("Profiles"));
accountMenuButton->setMenu(accountMenu);
accountMenuButton->setPopupMode(QToolButton::InstantPopup);
accountMenuButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@ -837,6 +836,21 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
// removing this looks stupid
view->setFocus();
retranslateUi();
}
void MainWindow::retranslateUi()
{
accountMenuButton->setText(tr("Profiles"));
if (m_selectedInstance) {
m_statusLeft->setText(m_selectedInstance->getStatusbarDescription());
} else {
m_statusLeft->setText(tr("No instance selected"));
}
ui->retranslateUi(this);
}
MainWindow::~MainWindow()
@ -1751,7 +1765,7 @@ void MainWindow::changeEvent(QEvent* event)
{
if (event->type() == QEvent::LanguageChange)
{
ui->retranslateUi(this);
retranslateUi();
}
QMainWindow::changeEvent(event);
}

View File

@ -187,6 +187,8 @@ private slots:
void globalSettingsClosed();
private:
void retranslateUi();
void addInstance(QString url = QString());
void activateInstance(InstancePtr instance);
void setCatBackground(bool enabled);