summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-15 14:39:25 +0100
committerSimon Rettberg2017-12-15 14:39:25 +0100
commitbd6829395e87becf24b97d288fe71e06d8f7b16a (patch)
tree97950eb82812cb682b4f539ec2392f2adf231972
parentGerman translation (diff)
downloadbeamergui-bd6829395e87becf24b97d288fe71e06d8f7b16a.tar.gz
beamergui-bd6829395e87becf24b97d288fe71e06d8f7b16a.tar.xz
beamergui-bd6829395e87becf24b97d288fe71e06d8f7b16a.zip
Apply proper translation at runtime
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/i18n/de.ts2
-rw-r--r--src/main.cpp8
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 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.0" language="de_DE">
+<TS version="2.1" language="de_DE">
<context>
<name>TimeOutDialog</name>
<message>
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();