diff options
author | Jamie Mansfield <jmansfield@cadixdev.org> | 2021-06-19 00:12:54 +0100 |
---|---|---|
committer | Jamie Mansfield <jmansfield@cadixdev.org> | 2021-06-19 00:14:36 +0100 |
commit | c92b44e6d6b376f3a114276f5deeaa5cfafd8b0d (patch) | |
tree | 3eb72acd717ffd1b698146b53eefe3430722c890 | |
parent | e148cfbbfd4af632afa484e2f9f164f0b1e642d4 (diff) | |
download | PrismLauncher-c92b44e6d6b376f3a114276f5deeaa5cfafd8b0d.tar.gz PrismLauncher-c92b44e6d6b376f3a114276f5deeaa5cfafd8b0d.tar.bz2 PrismLauncher-c92b44e6d6b376f3a114276f5deeaa5cfafd8b0d.zip |
GH-3719 Translate some missing strings when changing locale
-rw-r--r-- | application/MainWindow.cpp | 18 | ||||
-rw-r--r-- | application/MainWindow.h | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 9d046ddb..13a7c7ae 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -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); } diff --git a/application/MainWindow.h b/application/MainWindow.h index 3d4114de..08c6b969 100644 --- a/application/MainWindow.h +++ b/application/MainWindow.h @@ -187,6 +187,8 @@ private slots: void globalSettingsClosed(); private: + void retranslateUi(); + void addInstance(QString url = QString()); void activateInstance(InstancePtr instance); void setCatBackground(bool enabled); |