diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-03-06 18:46:28 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-03-06 19:34:32 +0100 |
| commit | 21c821c49ef82d1e84b0b9c8c3d357dc559479d4 (patch) | |
| tree | 254db9fe0d580942d1ec65cd9bf606456f7585ff /src/main.cpp | |
| parent | c257870c054cd893bd8a5c01a7a7865a8993f1ee (diff) | |
| download | kristall-21c821c49ef82d1e84b0b9c8c3d357dc559479d4.tar.gz | |
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.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 <QFontDatabase> #include <QLocalSocket> #include <QLocalServer> +#include <QLibraryInfo> #include <cassert> 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); |
