1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

LP-197 Add priority for Gcs translation file use

(Qt-5.5.1 qt_fr.qm file broken)
This commit is contained in:
Laurent Lalanne 2015-12-17 17:43:37 +01:00
parent 3faa8d621a
commit 6c8c643f48

View File

@ -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