mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-16 08: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:
commit
8df41f5863
@ -431,16 +431,19 @@ void loadTranslators(QString language, QTranslator &translator, QTranslator &qtT
|
|||||||
const QString &creatorTrPath = Utils::GetDataPath() + QLatin1String("translations");
|
const QString &creatorTrPath = Utils::GetDataPath() + QLatin1String("translations");
|
||||||
|
|
||||||
if (translator.load(QLatin1String("gcs_") + language, creatorTrPath)) {
|
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 &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
const QString &qtTrFile = QLatin1String("qt_") + language;
|
const QString &qtTrFile = QLatin1String("qt_") + language;
|
||||||
// Binary installer puts Qt tr files into creatorTrPath
|
// Binary installer puts Qt tr files into creatorTrPath
|
||||||
if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) {
|
if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) {
|
||||||
QCoreApplication::installTranslator(&translator);
|
// Install main qt_xx.qm translation file
|
||||||
QCoreApplication::installTranslator(&qtTranslator);
|
QCoreApplication::installTranslator(&qtTranslator);
|
||||||
} else {
|
|
||||||
// unload()
|
|
||||||
translator.load(QString());
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// unload(), no gcs translation found
|
||||||
|
translator.load(QString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace anonymous
|
} // namespace anonymous
|
||||||
|
Loading…
x
Reference in New Issue
Block a user