From 6c8c643f48675d3f751f0cf2f667648a1f2b5a11 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Thu, 17 Dec 2015 17:43:37 +0100 Subject: [PATCH] LP-197 Add priority for Gcs translation file use (Qt-5.5.1 qt_fr.qm file broken) --- ground/gcs/src/app/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ground/gcs/src/app/main.cpp b/ground/gcs/src/app/main.cpp index c8260c953..959fb07af 100644 --- a/ground/gcs/src/app/main.cpp +++ b/ground/gcs/src/app/main.cpp @@ -426,16 +426,19 @@ void loadTranslators(QString language, QTranslator &translator, QTranslator &qtT const QString &creatorTrPath = Utils::GetDataPath() + QLatin1String("translations"); if (translator.load(QLatin1String("gcs_") + language, creatorTrPath)) { + // Install gcs_xx.qm translation file + QCoreApplication::installTranslator(&translator); + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); const QString &qtTrFile = QLatin1String("qt_") + language; // Binary installer puts Qt tr files into creatorTrPath if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) { - QCoreApplication::installTranslator(&translator); + // Install main qt_xx.qm translation file QCoreApplication::installTranslator(&qtTranslator); - } else { - // unload() - translator.load(QString()); } + } else { + // unload(), no gcs translation found + translator.load(QString()); } } } // namespace anonymous