From bd6829395e87becf24b97d288fe71e06d8f7b16a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 15 Dec 2017 14:39:25 +0100 Subject: Apply proper translation at runtime --- CMakeLists.txt | 2 +- src/i18n/de.ts | 2 +- src/main.cpp | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b872522..65a4e72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ QT5_ADD_RESOURCES(BEAMERGUI_RC_SOURCES ${BEAMERGUI_RESOURCES}) add_executable(beamergui ${BEAMERGUI_SOURCES} ${BEAMERGUI_UI_HEADERS} -# ${BEAMERGUI_RC_SOURCES} + ${BEAMERGUI_RC_SOURCES} ${BEAMERGUI_QMS} ) diff --git a/src/i18n/de.ts b/src/i18n/de.ts index 481a35e..6e4a48a 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -1,6 +1,6 @@ - + TimeOutDialog diff --git a/src/main.cpp b/src/main.cpp index 7ae6558..801484a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,14 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + // System strings + QTranslator *qtTranslator = new QTranslator(&a); + qtTranslator->load(QLocale::system(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + a.installTranslator(qtTranslator); + // App specific + QTranslator *translator = new QTranslator(&a); + translator->load(QLocale::system(), ":"); + a.installTranslator(translator); Widget w; w.show(); return a.exec(); -- cgit v1.2.3-55-g7522