1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

Merged in f5soh/librepilot/LP-197_Qt-5.5.1_Fr_translation_broken (pull request #137)

LP-197 Broken translation with Qt-5.5.1
This commit is contained in:
Philippe Renon 2015-12-20 20:43:33 +01:00
commit 8df41f5863

View File

@ -431,16 +431,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