Frontend: Fix built-in Qt translations not loaded properly qt5transition
authorWuzzy <Wuzzy2@mail.ru>
Tue, 13 Mar 2018 18:25:37 +0100
branchqt5transition
changeset 13187 d2f8dafdb080
parent 13186 2148b493836e
child 13191 07c93d864bc2
Frontend: Fix built-in Qt translations not loaded properly
QTfrontend/main.cpp
--- a/QTfrontend/main.cpp	Tue Mar 13 16:57:20 2018 +0100
+++ b/QTfrontend/main.cpp	Tue Mar 13 18:25:37 2018 +0100
@@ -355,11 +355,12 @@
             if(cc == "C")
                 cc = HWApplication::inputMethod()->locale().name();
         }
+        qDebug("Frontend uses locale: %s", qPrintable(cc));
 
         // Load locale files into translators
-        if (!TranslatorHedgewars.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
+        if (!TranslatorHedgewars.load(QString("hedgewars_%1").arg(cc), QString("physfs://Locale")))
             qWarning("Failed to install Hedgewars translation (%s)", qPrintable(cc));
-        if (!TranslatorQt.load(QString("%1/qt_%2").arg(QLibraryInfo::location(QLibraryInfo::TranslationsPath), cc)))
+        if (!TranslatorQt.load(QString("qt_%1").arg(cc), QString(QLibraryInfo::location(QLibraryInfo::TranslationsPath))))
             qWarning("Failed to install Qt translation (%s)", qPrintable(cc));
         app.installTranslator(&TranslatorHedgewars);
         app.installTranslator(&TranslatorQt);