Skip to content

Commit f01c901

Browse files
committed
GUI - Output language loading logs to gui.log
Load the language after program output has been redirected to gui.log
1 parent 320d91f commit f01c901

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

app/gui/qt/mainwindow.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,6 @@ MainWindow::MainWindow(QApplication& app, QSplashScreen* splash)
161161
initPaths();
162162

163163
bool startupOK = false;
164-
this->sonicPii18n = new SonicPii18n(rootPath());
165-
std::cout << "Language setting: " << piSettings->language.toUtf8().constData() << std::endl;
166-
this->ui_language = sonicPii18n->determineUILanguage(piSettings->language);
167-
std::cout << "Using language: " << ui_language.toUtf8().constData() << std::endl;
168-
this->i18n = sonicPii18n->loadTranslations(ui_language);
169164

170165
#ifdef QT_OLD_API
171166
// Clear out old tasks from previous sessions if they still exist
@@ -183,15 +178,6 @@ MainWindow::MainWindow(QApplication& app, QSplashScreen* splash)
183178
std::cout << "[GUI] - ===========================" << std::endl;
184179
std::cout << "[GUI] - " << std::endl;
185180
std::cout << "[GUI] - " << guiID.toStdString() << std::endl;
186-
std::cout << "[GUI] - ui locale: " << ui_language.toUtf8().constData() << std::endl;
187-
std::cout << "[GUI] - sys locale: " << QLocale::system().name().toStdString() << std::endl;
188-
189-
190-
if(i18n) {
191-
std::cout << "[GUI] - translations available " << std::endl;
192-
} else {
193-
std::cout << "[GUI] - translations unavailable (using EN)" << std::endl;
194-
}
195181

196182
// dynamically discover port numbers and then check them this will
197183
// show an error dialogue to the user and then kill the app if any of
@@ -201,6 +187,19 @@ MainWindow::MainWindow(QApplication& app, QSplashScreen* splash)
201187
m_spAPI->Init(rootPath().toStdString());
202188
#endif
203189

190+
this->sonicPii18n = new SonicPii18n(rootPath());
191+
std::cout << "[GUI] - Language setting: " << piSettings->language.toUtf8().constData() << std::endl;
192+
std::cout << "[GUI] - System language: " << QLocale::system().name().toStdString() << std::endl;
193+
this->ui_language = sonicPii18n->determineUILanguage(piSettings->language);
194+
std::cout << "[GUI] - Using language: " << ui_language.toUtf8().constData() << std::endl;
195+
this->i18n = sonicPii18n->loadTranslations(ui_language);
196+
197+
if(i18n) {
198+
std::cout << "[GUI] - translations available " << std::endl;
199+
} else {
200+
std::cout << "[GUI] - translations unavailable (using EN)" << std::endl;
201+
}
202+
204203
std::cout << "[GUI] - hiding main window" << std::endl;
205204
hide();
206205

0 commit comments

Comments
 (0)