From 427646b8d7c52e5b84240e07ffd391217ce3bfa8 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 4 Sep 2014 14:29:21 +0200 Subject: use the new form of QTranslator::load() for more flexibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As the docs explain, the variant of QTranslator::load() taking a const QLocale& is better because it "uses QLocale::uiLanguages() and not simply the locale name, which refers to the formatting of dates and numbers and not necessarily the UI language." And, using a default-constructed QLocale permits QLocale::setDefault() to override the system locale, so for example an application's main.cpp can do that before constructing a QQmlApplicationEngine. Task-number: QTBUG-7329 Change-Id: Ia29a4c894087c92b071c0fe484728866f2660fe6 Reviewed-by: Jan Arve Sæther --- tools/qml/main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tools/qml/main.cpp') diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 69ccd7a316..7a08562a13 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -450,10 +450,8 @@ int main(int argc, char *argv[]) verboseMode = false; #ifndef QT_NO_TRANSLATION - //qt_ translations loaded by QQmlApplicationEngine - QString sysLocale = QLocale::system().name(); - - if (!translationFile.isEmpty()) { //Note: installed before QQmlApplicationEngine's automatic translation loading + // qt_ translations are loaded by QQmlApplicationEngine + if (!translationFile.isEmpty()) { // Note: installed before QQmlApplicationEngine's automatic translation loading QTranslator translator; if (translator.load(translationFile)) { -- cgit v1.2.3