From 9f6697ab63f7f03d487ba6aedffa5abfe30cd04f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 16 Feb 2023 21:24:09 +0200 Subject: [PATCH] Add path to translation when run an app from install root. --- src/libs/vmisc/vabstractapplication.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index e60731ce0..71ed41b99 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -217,6 +217,18 @@ auto VAbstractApplication::translationsPath(const QString &locale) -> QString return dir.absolutePath(); } +#ifdef QBS_BUILD +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + dir.setPath(QCoreApplication::applicationDirPath() + "/../../.." + PKGDATADIR + trPath); +#else + dir = QDir(QCoreApplication::applicationDirPath() + "/../../.." + PKGDATADIR + trPath); +#endif + if (dir.exists()) + { + return dir.absolutePath(); + } +#endif // QBS_BUILD + #if defined(APPIMAGE) && defined(Q_OS_LINUX) /* Fix path to trasnaltions when run inside AppImage. */ return AppImageRoot() + PKGDATADIR + trPath;