summary refs log tree commit diff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-10 03:17:23 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-10 03:17:23 +0200
commitda2f80df60c7ca99efdf88c528fc357a052f4c3f (patch)
treedabaff92667e2fdca6c8c73ed705e3dcb192ab50 /src/main.cpp
parentFetch missing events (diff)
downloadnheko-da2f80df60c7ca99efdf88c528fc357a052f4c3f.tar.xz
Fix translation loading
Explanation see here:
https://www.kdab.com/fixing-a-common-antipattern-when-loading-translations-in-qt/
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 46691e6f..e02ffa36 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -173,11 +173,12 @@ main(int argc, char *argv[])
         QString lang = QLocale::system().name();
 
         QTranslator qtTranslator;
-        qtTranslator.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+        qtTranslator.load(
+          QLocale(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
         app.installTranslator(&qtTranslator);
 
         QTranslator appTranslator;
-        appTranslator.load("nheko_" + lang, ":/translations");
+        appTranslator.load(QLocale(), "nheko", "_", ":/translations");
         app.installTranslator(&appTranslator);
 
         MainWindow w;