diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-07-10 03:17:23 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-07-10 03:17:23 +0200 |
commit | da2f80df60c7ca99efdf88c528fc357a052f4c3f (patch) | |
tree | dabaff92667e2fdca6c8c73ed705e3dcb192ab50 /src/main.cpp | |
parent | Fetch missing events (diff) | |
download | nheko-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.cpp | 5 |
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; |