From 42f0e653ccf45c92cc3b6e5b9f55ec17b59e7222 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Mon, 9 Feb 2015 18:59:57 +0100 Subject: [PATCH] =?UTF-8?q?Install=20translator=20for=20pre-set=20locale?= =?UTF-8?q?=20if=20the=20UI=20language=20is=20not=20changed.=20Thanks=20Wi?= =?UTF-8?q?nfried=20Kusg=C3=B6rd=20=20for=20the=20pat?= =?UTF-8?q?ch.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/greeting/GreetingPage.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/greeting/GreetingPage.cpp b/src/modules/greeting/GreetingPage.cpp index 14713df5d..cd302537e 100644 --- a/src/modules/greeting/GreetingPage.cpp +++ b/src/modules/greeting/GreetingPage.cpp @@ -61,6 +61,8 @@ GreetingPage::GreetingPage( QWidget* parent ) { isTranslationAvailable = true; ui->languageWidget->setCurrentRow( ui->languageWidget->count() - 1 ); + cDebug() << "Initial locale " << thisLocale.name(); + CalamaresUtils::installTranslator( thisLocale.name(), qApp ); } } ui->languageWidget->sortItems(); @@ -74,6 +76,8 @@ GreetingPage::GreetingPage( QWidget* parent ) { isTranslationAvailable = true; ui->languageWidget->setCurrentRow( i ); + cDebug() << "Initial locale " << thisLocale.name(); + CalamaresUtils::installTranslator( thisLocale.name(), qApp ); break; } } @@ -87,6 +91,9 @@ GreetingPage::GreetingPage( QWidget* parent ) if ( thisLocale == QLocale( QLocale::English, QLocale::UnitedStates ) ) { ui->languageWidget->setCurrentRow( i ); + cDebug() << "Translation unavailable, so initial locale set to " << thisLocale.name(); + QLocale::setDefault( thisLocale ); + CalamaresUtils::installTranslator( thisLocale.name(), qApp ); break; } }