diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-11-04 18:40:24 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-11-04 19:48:09 +0100 |
commit | f08dc187499d2895f50f7e2e7e99bf698b0c0738 (patch) | |
tree | 7b15638804b92fb99ffa07dc45fb29aef4d7cd80 /gui/main.cpp | |
parent | a308e5cd2c6769750f8f6b4e486a8e66b591dafe (diff) |
cmake, main: add translation support
Diffstat (limited to 'gui/main.cpp')
-rw-r--r-- | gui/main.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gui/main.cpp b/gui/main.cpp index 763f1cb5..de904f94 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -5,6 +5,8 @@ # include <QCoreApplication> # include <QFile> # include <QString> +# include <QLocale> +# include <QTranslator> #endif #include "migration/migration.hpp" @@ -128,6 +130,8 @@ main(int argc, char** argv) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif QApplication::setAttribute(Qt::AA_X11InitThreads, true); + + QTranslator t; QApplication app(argc, argv); set_qt_style(); @@ -137,6 +141,11 @@ main(int argc, char** argv) add_win32_path(); #endif + // QLocale::setDefault(QLocale("pl_PL")); // force i18n for testing + + (void) t.load(QLocale(), "", "", QCoreApplication::applicationDirPath() + "/i18n", ".qm"); + (void) QCoreApplication::installTranslator(&t); + do { mem<MainWindow> w = std::make_shared<MainWindow>(); |