From 21c821c49ef82d1e84b0b9c8c3d357dc559479d4 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sat, 6 Mar 2021 18:46:28 +0100 Subject: main.cpp: use QLibraryInfo to get the exact i18n path Qt translation files were chosen only when you were in /usr/*, because of the relative path. Changing it to use QLibraryInfo fixes that. --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 434b8e9..80f86f2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include ProtocolSetup kristall::protocols; @@ -386,7 +387,7 @@ int main(int argc, char *argv[]) }); QTranslator trans, qttrans; - qttrans.load(QLocale(), QLatin1String("qt"), "_", "../share/qt5/translations"); + qttrans.load(QLocale(), QLatin1String("qt"), "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)); trans.load(QLocale(), QLatin1String("kristall"), QLatin1String("_"), QLatin1String(":/i18n")); app.installTranslator(&qttrans); app.installTranslator(&trans); -- cgit v1.2.3