summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Darmochwal2010-10-06 01:35:05 +0200
committerJan Darmochwal2010-10-06 01:35:05 +0200
commitbf7453843683494b81dd70232a2093577db34289 (patch)
treefed26399810a9fa58b974c3d71a72e0c19cab74d /src
parenthighlight previous session (diff)
downloadvmchooser-bf7453843683494b81dd70232a2093577db34289.tar.gz
vmchooser-bf7453843683494b81dd70232a2093577db34289.tar.xz
vmchooser-bf7453843683494b81dd70232a2093577db34289.zip
i18n support and German translation
Translation can be done with .ts-files in src/i18n/de.ts. The resulting .qm-files are stored as resources in the program binary. build.sh has a new option --update-translations that causes the .ts files to be updated
Diffstat (limited to 'src')
-rw-r--r--src/dialog.cpp2
-rw-r--r--src/i18n/de.ts72
-rw-r--r--src/main.cpp9
-rw-r--r--src/ui/dialog.ui4
4 files changed, 82 insertions, 5 deletions
diff --git a/src/dialog.cpp b/src/dialog.cpp
index 6a931ca..7ebfbcc 100644
--- a/src/dialog.cpp
+++ b/src/dialog.cpp
@@ -16,7 +16,7 @@ Dialog::Dialog(QWidget *parent) :
if (ifaceDBus_->isValid()) {
// PVS is running
QStringList accessOptions;
- accessOptions << "None" << "View Only" << "Full";
+ accessOptions << tr("None") << tr("View Only") << tr("Full");
ui->comboBoxLecturer->insertItems(0, accessOptions);
ui->comboBoxOthers->insertItems(0, accessOptions);
diff --git a/src/i18n/de.ts b/src/i18n/de.ts
new file mode 100644
index 0000000..b8063d6
--- /dev/null
+++ b/src/i18n/de.ts
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="de">
+<context>
+ <name>Dialog</name>
+ <message>
+ <location filename="../ui/dialog.ui" line="14"/>
+ <source>vmchooser</source>
+ <translation>vmchooser</translation>
+ </message>
+ <message>
+ <location filename="../ui/dialog.ui" line="36"/>
+ <source>PVS Options</source>
+ <translation>PVS Einstellungen</translation>
+ </message>
+ <message>
+ <location filename="../ui/dialog.ui" line="44"/>
+ <source>VNC access by lecturer:</source>
+ <translation>VNC-Zugriff für Dozenten:</translation>
+ </message>
+ <message>
+ <location filename="../ui/dialog.ui" line="61"/>
+ <source>VNC access by others:</source>
+ <translation>VNC-Zugriff für andere:</translation>
+ </message>
+ <message>
+ <location filename="../ui/dialog.ui" line="102"/>
+ <source>Accept chat messages</source>
+ <translation>Chat-Nachrichten akzeptieren</translation>
+ </message>
+ <message>
+ <location filename="../ui/dialog.ui" line="109"/>
+ <source>Accept file transfers</source>
+ <translation>Dateiübertragungen akzeptieren</translation>
+ </message>
+ <message>
+ <location filename="../ui/dialog.ui" line="149"/>
+ <source>Abort</source>
+ <translation>Abbrechen</translation>
+ </message>
+ <message>
+ <location filename="../ui/dialog.ui" line="156"/>
+ <source>Start</source>
+ <translation>Start</translation>
+ </message>
+ <message>
+ <location filename="../dialog.cpp" line="19"/>
+ <source>None</source>
+ <translation>kein Zugriff</translation>
+ </message>
+ <message>
+ <location filename="../dialog.cpp" line="19"/>
+ <source>View Only</source>
+ <translation>nur ansehen</translation>
+ </message>
+ <message>
+ <location filename="../dialog.cpp" line="19"/>
+ <source>Full</source>
+ <translation>Vollzugriff</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="196"/>
+ <source>X Sessions</source>
+ <translation>X Sitzungen</translation>
+ </message>
+ <message>
+ <location filename="../main.cpp" line="197"/>
+ <source>Virtual Sessions</source>
+ <translation>Virtuelle Sitzungen</translation>
+ </message>
+</context>
+</TS>
diff --git a/src/main.cpp b/src/main.cpp
index 6766403..c44d362 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3,6 +3,7 @@
#include <iostream>
#include <stdlib.h>
+#include <QTranslator>
#include "save_restore_session.h"
#include "xsession.h"
#include "vsession.h"
@@ -18,6 +19,10 @@ using namespace std;
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
+ QTranslator translator;
+ translator.load(":" + QLocale::system().name());
+ a.installTranslator(&translator);
+
string version = "0.0.13";
AnyOption* opt = new AnyOption();
char* xmlpath = NULL;
@@ -188,8 +193,8 @@ int main(int argc, char *argv[]) {
Dialog w;
w.resize(width, height);
- w.addItems(xsessions, "X Sessions");
- w.addItems(vsessions, "Virtual Sessions");
+ w.addItems(xsessions, a.translate("Dialog", "X Sessions"));
+ w.addItems(vsessions, a.translate("Dialog", "Virtual Sessions"));
w.selectPreviousSession();
w.show();
return a.exec();
diff --git a/src/ui/dialog.ui b/src/ui/dialog.ui
index fe03b5d..6594b63 100644
--- a/src/ui/dialog.ui
+++ b/src/ui/dialog.ui
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
- <string>Dialog</string>
+ <string>vmchooser</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
@@ -146,7 +146,7 @@
<item>
<widget class="QPushButton" name="pushButtonAbort">
<property name="text">
- <string>Abbrechen</string>
+ <string>Abort</string>
</property>
</widget>
</item>