Workaround for FHS mode for translations

This commit is contained in:
Taras Kushnir
2017-11-05 17:35:54 +02:00
parent 05ee513566
commit 148e6bb3cc
+12 -3
View File
@@ -1609,9 +1609,18 @@ void deployTranslations(const QString &appDirPath, quint64 usedQtModules)
return; return;
} }
QString translationsDirPath = appDirPath + QStringLiteral("/translations"); QString translationsDirPath;
LogDebug() << "Using" << translationsDirPath << "as translations directory for App"; if (!fhsLikeMode) {
LogDebug() << "Using" << qtTranslationsPath << " to search for Qt translations"; translationsDirPath = appDirPath + QStringLiteral("/translations");
} else {
// TODO: refactor this global variables hack
QFileInfo appBinaryFI(appBinaryPath);
QString appRoot = appBinaryFI.absoluteDir().absolutePath() + "/../";
translationsDirPath = appRoot + QStringLiteral("/translations");
}
LogNormal() << "Using" << translationsDirPath << "as translations directory for App";
LogNormal() << "Using" << qtTranslationsPath << " to search for Qt translations";
QFileInfo fi(translationsDirPath); QFileInfo fi(translationsDirPath);
if (!fi.isDir()) { if (!fi.isDir()) {