From 8ed8f90effab0876a8d8374d787d8c3b6214c531 Mon Sep 17 00:00:00 2001
From: Sebastien Braun
Date: Fri, 8 Oct 2010 22:01:39 +0200
Subject: Move the translations for pvsinput into the library where they
belong.
---
src/input/CMakeLists.txt | 27 +++++++
src/input/i18n.h | 33 ++++++++
src/input/i18n/pvsinput_ar_JO.ts | 147 ++++++++++++++++++++++++++++++++++
src/input/i18n/pvsinput_de_DE.ts | 165 +++++++++++++++++++++++++++++++++++++++
src/input/i18n/pvsinput_es_MX.ts | 147 ++++++++++++++++++++++++++++++++++
src/input/i18n/pvsinput_fr_FR.ts | 147 ++++++++++++++++++++++++++++++++++
src/input/i18n/pvsinput_pl_PL.ts | 147 ++++++++++++++++++++++++++++++++++
src/input/inputEvent.cpp | 48 ++++++------
src/input/inputEvent.h | 7 ++
src/pvsmgr.cpp | 3 +
src/pvsmgrtouch.cpp | 3 +
11 files changed, 850 insertions(+), 24 deletions(-)
create mode 100644 src/input/i18n.h
create mode 100644 src/input/i18n/pvsinput_ar_JO.ts
create mode 100644 src/input/i18n/pvsinput_de_DE.ts
create mode 100644 src/input/i18n/pvsinput_es_MX.ts
create mode 100644 src/input/i18n/pvsinput_fr_FR.ts
create mode 100644 src/input/i18n/pvsinput_pl_PL.ts
(limited to 'src')
diff --git a/src/input/CMakeLists.txt b/src/input/CMakeLists.txt
index 689fd39..e14cdb4 100644
--- a/src/input/CMakeLists.txt
+++ b/src/input/CMakeLists.txt
@@ -110,8 +110,35 @@ if(UNIX)
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
endif()
+set(pvsinput_TSS
+ i18n/pvsinput_de_DE.ts
+ i18n/pvsinput_fr_FR.ts
+ i18n/pvsinput_es_MX.ts
+ i18n/pvsinput_ar_JO.ts
+ i18n/pvsinput_pl_PL.ts)
+
+QT4_CREATE_TRANSLATION(pvsinput_QMS
+ ${pvsinput_SRCS}
+ ${pvsprivinputd_SRCS}
+ ${pvsinput_TSS})
+
+# Generate an RCC file for our translations:
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pvsinput.qrc"
+ "")
+foreach(qm ${pvsinput_QMS})
+ file(RELATIVE_PATH qm_rel ${CMAKE_CURRENT_BINARY_DIR} ${qm})
+ get_filename_component(qm_basename ${qm} NAME)
+ file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pvsinput.qrc"
+ "${qm_rel}")
+endforeach()
+file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pvsinput.qrc" "")
+
+qt4_add_resources(pvsinput_RCS
+ "${CMAKE_CURRENT_BINARY_DIR}/pvsinput.qrc")
+
add_library(
pvsinput
STATIC
${pvsinput_SRCS}
+ ${pvsinput_RCS}
)
diff --git a/src/input/i18n.h b/src/input/i18n.h
new file mode 100644
index 0000000..d64c7cf
--- /dev/null
+++ b/src/input/i18n.h
@@ -0,0 +1,33 @@
+/*
+ # Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg
+ #
+ # This program is free software distributed under the GPL version 2.
+ # See http://openslx.org/COPYING
+ #
+ # If you have any feedback please consult http://openslx.org/feedback and
+ # send your suggestions, praise, or complaints to feedback@openslx.org
+ #
+ # General information about OpenSLX can be found at http://openslx.org/
+ # --------------------------------------------------------------------------
+ # i18n.h:
+ # - For library users: Make sure the translations are linked and registered
+ # --------------------------------------------------------------------------
+ */
+
+#ifndef I18N_H_
+#define I18N_H_
+
+#include
+#include
+#include
+
+#define USE_PVSINPUT_TRANSLATIONS \
+ do { \
+ Q_INIT_RESOURCE(pvsinput); \
+ QTranslator* translator = new QTranslator(QCoreApplication::instance()); \
+ translator->load("pvsinput_" + QLocale::system().name(), ":/i18n/pvsinput"); \
+ QCoreApplication::instance()->installTranslator(translator); \
+ } while(false)
+
+
+#endif /* I18N_H_ */
diff --git a/src/input/i18n/pvsinput_ar_JO.ts b/src/input/i18n/pvsinput_ar_JO.ts
new file mode 100644
index 0000000..1040142
--- /dev/null
+++ b/src/input/i18n/pvsinput_ar_JO.ts
@@ -0,0 +1,147 @@
+
+
+
+
+ InputEvent
+
+
+ Say Hello
+
+
+
+
+ Reboot
+
+
+
+
+ Kill X Server
+
+
+
+
+ Reboot immediately
+
+
+
+
+ Power off immediately
+
+
+
+
+ Crash System
+
+
+
+
+ Turn off raw keyboard mode
+
+
+
+
+ Send SIGTERM to all
+
+
+
+
+ Send SIGKILL to all
+
+
+
+
+ Kill all on this terminal
+
+
+
+
+ Activate OOM killer
+
+
+
+
+ Make real-time tasks niceable
+
+
+
+
+ Force-thaw filesystems
+
+
+
+
+ Sync all mounted filesystems
+
+
+
+
+ Remount all readonly
+
+
+
+
+ Show all held locks
+
+
+
+
+ Show stack traces
+
+
+
+
+ Dump memory info
+
+
+
+
+ Dump registers and flags
+
+
+
+
+ Dump timers and clockevents
+
+
+
+
+ Dump task list
+
+
+
+
+ Dump uninterruptible tasks
+
+
+
+
+ Dump ftrace buffer
+
+
+
+
+ QObject
+
+
+ Usage: %1 [--help|-h] [--daemon|-d] [--log=<Logger>|-l<Logger>]
+
+Options:
+ --help, -h Show this message
+ --daemon, -d Run in background
+ --log=<Logger>,
+ -l<Logger> Redirect all output to <Logger>
+ valid values are:
+ - any file name
+ - `syslog' to redirect output to the system log
+ - `null' to discard output (default)
+ (without quotes)
+
+Signals:
+ SIGINT, SIGTERM (or press Ctrl+C when run in foreground)
+ Quit
+ SIGHUP Reload configuration and cached user data
+
+
+
+
+
diff --git a/src/input/i18n/pvsinput_de_DE.ts b/src/input/i18n/pvsinput_de_DE.ts
new file mode 100644
index 0000000..56ebf26
--- /dev/null
+++ b/src/input/i18n/pvsinput_de_DE.ts
@@ -0,0 +1,165 @@
+
+
+
+
+ InputEvent
+
+
+ Say Hello
+ Hallo sagen
+
+
+
+ Reboot
+ Neustart
+
+
+
+ Kill X Server
+ X-Server töten
+
+
+
+ Reboot immediately
+ Sofort neu starten
+
+
+
+ Power off immediately
+ Sofort abschalten
+
+
+
+ Crash System
+ Systemabsturz
+
+
+
+ Turn off raw keyboard mode
+ RAW-Tastatur-Modus abschalten
+
+
+
+ Send SIGTERM to all
+ SIGTERM an alle Prozesse senden
+
+
+
+ Send SIGKILL to all
+ SIGKILL an alle Prozesse senden
+
+
+
+ Kill all on this terminal
+ Alle Prozesse an diesem Terminal töten
+
+
+
+ Activate OOM killer
+ OOM-Killer aktivieren
+
+
+
+ Make real-time tasks niceable
+ Nice für Echtzeitprozesse ermöglichen
+
+
+
+ Force-thaw filesystems
+
+
+
+
+ Sync all mounted filesystems
+ Alle eingebundenen Dateisysteme sync(2)en
+
+
+
+ Remount all readonly
+ Alle Dateisysteme nur-lesbar mounten
+
+
+
+ Show all held locks
+ Alle gehaltenen Sperren zeigen
+
+
+
+ Show stack traces
+ Stacktraces anzigen
+
+
+
+ Dump memory info
+ Speicherinfo anzeigen
+
+
+
+ Dump registers and flags
+ Register und Flags anzeigen
+
+
+
+ Dump timers and clockevents
+ Timer und Clockevents anzeigen
+
+
+
+ Dump task list
+ Taskliste anzeigen
+
+
+
+ Dump uninterruptible tasks
+ Ununterbrechbare Tasks anzeigen
+
+
+
+ Dump ftrace buffer
+ ftrace-Puffer anzeigen
+
+
+
+ QObject
+
+
+ Usage: %1 [--help|-h] [--daemon|-d] [--log=<Logger>|-l<Logger>]
+
+Options:
+ --help, -h Show this message
+ --daemon, -d Run in background
+ --log=<Logger>,
+ -l<Logger> Redirect all output to <Logger>
+ valid values are:
+ - any file name
+ - `syslog' to redirect output to the system log
+ - `null' to discard output (default)
+ (without quotes)
+
+Signals:
+ SIGINT, SIGTERM (or press Ctrl+C when run in foreground)
+ Quit
+ SIGHUP Reload configuration and cached user data
+
+ Verwendung: %1 [--help|-h] [--daemon|-d] [--log=<Logger>|-l<Logger>]
+
+Optionen:
+ --help, -h Diese Nachricht anzeigen
+ --daemon, -d Im Hintergrund laufen
+ --log=<Logger>,
+ -l<Logger> Alle Ausgaben an <Logger> weiterleiten
+ Mögliche Werte für <Logger>:
+ - Ein Dateiname
+ - `syslog', um Ausgaben an das Systemlog zu leiten
+ - `null', um Ausgaben zu verwerfen
+ Standardwert: null
+ Werte ohne Anführungszeichen eingeben
+
+Signale:
+ SIGINT, SIGTERM (oder Strg+C wenn nicht im Hintergrund)
+ Beenden
+ SIGHUP Konfiguration und Benutzerdatenbank neu laden
+
+
+
+
diff --git a/src/input/i18n/pvsinput_es_MX.ts b/src/input/i18n/pvsinput_es_MX.ts
new file mode 100644
index 0000000..047c59c
--- /dev/null
+++ b/src/input/i18n/pvsinput_es_MX.ts
@@ -0,0 +1,147 @@
+
+
+
+
+ InputEvent
+
+
+ Say Hello
+
+
+
+
+ Reboot
+
+
+
+
+ Kill X Server
+
+
+
+
+ Reboot immediately
+
+
+
+
+ Power off immediately
+
+
+
+
+ Crash System
+
+
+
+
+ Turn off raw keyboard mode
+
+
+
+
+ Send SIGTERM to all
+
+
+
+
+ Send SIGKILL to all
+
+
+
+
+ Kill all on this terminal
+
+
+
+
+ Activate OOM killer
+
+
+
+
+ Make real-time tasks niceable
+
+
+
+
+ Force-thaw filesystems
+
+
+
+
+ Sync all mounted filesystems
+
+
+
+
+ Remount all readonly
+
+
+
+
+ Show all held locks
+
+
+
+
+ Show stack traces
+
+
+
+
+ Dump memory info
+
+
+
+
+ Dump registers and flags
+
+
+
+
+ Dump timers and clockevents
+
+
+
+
+ Dump task list
+
+
+
+
+ Dump uninterruptible tasks
+
+
+
+
+ Dump ftrace buffer
+
+
+
+
+ QObject
+
+
+ Usage: %1 [--help|-h] [--daemon|-d] [--log=<Logger>|-l<Logger>]
+
+Options:
+ --help, -h Show this message
+ --daemon, -d Run in background
+ --log=<Logger>,
+ -l<Logger> Redirect all output to <Logger>
+ valid values are:
+ - any file name
+ - `syslog' to redirect output to the system log
+ - `null' to discard output (default)
+ (without quotes)
+
+Signals:
+ SIGINT, SIGTERM (or press Ctrl+C when run in foreground)
+ Quit
+ SIGHUP Reload configuration and cached user data
+
+
+
+
+
diff --git a/src/input/i18n/pvsinput_fr_FR.ts b/src/input/i18n/pvsinput_fr_FR.ts
new file mode 100644
index 0000000..8e3e417
--- /dev/null
+++ b/src/input/i18n/pvsinput_fr_FR.ts
@@ -0,0 +1,147 @@
+
+
+
+
+ InputEvent
+
+
+ Say Hello
+
+
+
+
+ Reboot
+
+
+
+
+ Kill X Server
+
+
+
+
+ Reboot immediately
+
+
+
+
+ Power off immediately
+
+
+
+
+ Crash System
+
+
+
+
+ Turn off raw keyboard mode
+
+
+
+
+ Send SIGTERM to all
+
+
+
+
+ Send SIGKILL to all
+
+
+
+
+ Kill all on this terminal
+
+
+
+
+ Activate OOM killer
+
+
+
+
+ Make real-time tasks niceable
+
+
+
+
+ Force-thaw filesystems
+
+
+
+
+ Sync all mounted filesystems
+
+
+
+
+ Remount all readonly
+
+
+
+
+ Show all held locks
+
+
+
+
+ Show stack traces
+
+
+
+
+ Dump memory info
+
+
+
+
+ Dump registers and flags
+
+
+
+
+ Dump timers and clockevents
+
+
+
+
+ Dump task list
+
+
+
+
+ Dump uninterruptible tasks
+
+
+
+
+ Dump ftrace buffer
+
+
+
+
+ QObject
+
+
+ Usage: %1 [--help|-h] [--daemon|-d] [--log=<Logger>|-l<Logger>]
+
+Options:
+ --help, -h Show this message
+ --daemon, -d Run in background
+ --log=<Logger>,
+ -l<Logger> Redirect all output to <Logger>
+ valid values are:
+ - any file name
+ - `syslog' to redirect output to the system log
+ - `null' to discard output (default)
+ (without quotes)
+
+Signals:
+ SIGINT, SIGTERM (or press Ctrl+C when run in foreground)
+ Quit
+ SIGHUP Reload configuration and cached user data
+
+
+
+
+
diff --git a/src/input/i18n/pvsinput_pl_PL.ts b/src/input/i18n/pvsinput_pl_PL.ts
new file mode 100644
index 0000000..87527d5
--- /dev/null
+++ b/src/input/i18n/pvsinput_pl_PL.ts
@@ -0,0 +1,147 @@
+
+
+
+
+ InputEvent
+
+
+ Say Hello
+
+
+
+
+ Reboot
+
+
+
+
+ Kill X Server
+
+
+
+
+ Reboot immediately
+
+
+
+
+ Power off immediately
+
+
+
+
+ Crash System
+
+
+
+
+ Turn off raw keyboard mode
+
+
+
+
+ Send SIGTERM to all
+
+
+
+
+ Send SIGKILL to all
+
+
+
+
+ Kill all on this terminal
+
+
+
+
+ Activate OOM killer
+
+
+
+
+ Make real-time tasks niceable
+
+
+
+
+ Force-thaw filesystems
+
+
+
+
+ Sync all mounted filesystems
+
+
+
+
+ Remount all readonly
+
+
+
+
+ Show all held locks
+
+
+
+
+ Show stack traces
+
+
+
+
+ Dump memory info
+
+
+
+
+ Dump registers and flags
+
+
+
+
+ Dump timers and clockevents
+
+
+
+
+ Dump task list
+
+
+
+
+ Dump uninterruptible tasks
+
+
+
+
+ Dump ftrace buffer
+
+
+
+
+ QObject
+
+
+ Usage: %1 [--help|-h] [--daemon|-d] [--log=<Logger>|-l<Logger>]
+
+Options:
+ --help, -h Show this message
+ --daemon, -d Run in background
+ --log=<Logger>,
+ -l<Logger> Redirect all output to <Logger>
+ valid values are:
+ - any file name
+ - `syslog' to redirect output to the system log
+ - `null' to discard output (default)
+ (without quotes)
+
+Signals:
+ SIGINT, SIGTERM (or press Ctrl+C when run in foreground)
+ Quit
+ SIGHUP Reload configuration and cached user data
+
+
+
+
+
diff --git a/src/input/inputEvent.cpp b/src/input/inputEvent.cpp
index f5abf43..fa623e1 100644
--- a/src/input/inputEvent.cpp
+++ b/src/input/inputEvent.cpp
@@ -99,33 +99,33 @@ InputEvent InputEvent::keyboardRelease(int key, int mods)
}
#define describe(list, description, type, code, value) \
- list.append(SpecialInputEventDescription(InputEvent::type, InputEvent::code, value, QCoreApplication::translate("InputEvent", description)))
+ list.append(SpecialInputEventDescription(InputEvent::type, InputEvent::code, value, description))
QList SpecialInputEventDescription::describeSpecialEvents()
{
QList list;
- describe(list, "Say Hello", ET_SPECIAL, EC_SAY_HELLO, 0);
- describe(list, "Reboot", ET_SPECIAL, EC_REBOOT, 0);
- describe(list, "Kill X Server", ET_SPECIAL, EC_KILL_X, 0);
- describe(list, "Reboot immediately", ET_SPECIAL, EC_SYSRQ, 'b');
- describe(list, "Power off immediately", ET_SPECIAL, EC_SYSRQ, 'o');
- describe(list, "Crash System", ET_SPECIAL, EC_SYSRQ, 'c');
- describe(list, "Turn off raw keyboard mode", ET_SPECIAL, EC_SYSRQ, 'r');
- describe(list, "Send SIGTERM to all", ET_SPECIAL, EC_SYSRQ, 'e');
- describe(list, "Send SIGKILL to all", ET_SPECIAL, EC_SYSRQ, 'i');
- describe(list, "Kill all on this terminal", ET_SPECIAL, EC_SYSRQ, 'k');
- describe(list, "Activate OOM killer", ET_SPECIAL, EC_SYSRQ, 'f');
- describe(list, "Make real-time tasks niceable", ET_SPECIAL, EC_SYSRQ, 'n');
- describe(list, "Force-thaw filesystems", ET_SPECIAL, EC_SYSRQ, 'j');
- describe(list, "Sync all mounted filesystems", ET_SPECIAL, EC_SYSRQ, 's');
- describe(list, "Remount all readonly", ET_SPECIAL, EC_SYSRQ, 'u');
- describe(list, "Show all held locks", ET_SPECIAL, EC_SYSRQ, 'd');
- describe(list, "Show stack traces", ET_SPECIAL, EC_SYSRQ, 'l');
- describe(list, "Dump memory info", ET_SPECIAL, EC_SYSRQ, 'm');
- describe(list, "Dump registers and flags", ET_SPECIAL, EC_SYSRQ, 'p');
- describe(list, "Dump timers and clockevents", ET_SPECIAL, EC_SYSRQ, 'q');
- describe(list, "Dump task list", ET_SPECIAL, EC_SYSRQ, 't');
- describe(list, "Dump uninterruptible tasks", ET_SPECIAL, EC_SYSRQ, 'w');
- describe(list, "Dump ftrace buffer", ET_SPECIAL, EC_SYSRQ, 'z');
+ describe(list, InputEvent::tr("Say Hello"), ET_SPECIAL, EC_SAY_HELLO, 0);
+ describe(list, InputEvent::tr("Reboot"), ET_SPECIAL, EC_REBOOT, 0);
+ describe(list, InputEvent::tr("Kill X Server"), ET_SPECIAL, EC_KILL_X, 0);
+ describe(list, InputEvent::tr("Reboot immediately"), ET_SPECIAL, EC_SYSRQ, 'b');
+ describe(list, InputEvent::tr("Power off immediately"), ET_SPECIAL, EC_SYSRQ, 'o');
+ describe(list, InputEvent::tr("Crash System"), ET_SPECIAL, EC_SYSRQ, 'c');
+ describe(list, InputEvent::tr("Turn off raw keyboard mode"), ET_SPECIAL, EC_SYSRQ, 'r');
+ describe(list, InputEvent::tr("Send SIGTERM to all"), ET_SPECIAL, EC_SYSRQ, 'e');
+ describe(list, InputEvent::tr("Send SIGKILL to all"), ET_SPECIAL, EC_SYSRQ, 'i');
+ describe(list, InputEvent::tr("Kill all on this terminal"), ET_SPECIAL, EC_SYSRQ, 'k');
+ describe(list, InputEvent::tr("Activate OOM killer"), ET_SPECIAL, EC_SYSRQ, 'f');
+ describe(list, InputEvent::tr("Make real-time tasks niceable"), ET_SPECIAL, EC_SYSRQ, 'n');
+ describe(list, InputEvent::tr("Force-thaw filesystems"), ET_SPECIAL, EC_SYSRQ, 'j');
+ describe(list, InputEvent::tr("Sync all mounted filesystems"), ET_SPECIAL, EC_SYSRQ, 's');
+ describe(list, InputEvent::tr("Remount all readonly"), ET_SPECIAL, EC_SYSRQ, 'u');
+ describe(list, InputEvent::tr("Show all held locks"), ET_SPECIAL, EC_SYSRQ, 'd');
+ describe(list, InputEvent::tr("Show stack traces"), ET_SPECIAL, EC_SYSRQ, 'l');
+ describe(list, InputEvent::tr("Dump memory info"), ET_SPECIAL, EC_SYSRQ, 'm');
+ describe(list, InputEvent::tr("Dump registers and flags"), ET_SPECIAL, EC_SYSRQ, 'p');
+ describe(list, InputEvent::tr("Dump timers and clockevents"), ET_SPECIAL, EC_SYSRQ, 'q');
+ describe(list, InputEvent::tr("Dump task list"), ET_SPECIAL, EC_SYSRQ, 't');
+ describe(list, InputEvent::tr("Dump uninterruptible tasks"), ET_SPECIAL, EC_SYSRQ, 'w');
+ describe(list, InputEvent::tr("Dump ftrace buffer"), ET_SPECIAL, EC_SYSRQ, 'z');
return list;
}
diff --git a/src/input/inputEvent.h b/src/input/inputEvent.h
index 2f557ce..82b059c 100644
--- a/src/input/inputEvent.h
+++ b/src/input/inputEvent.h
@@ -18,6 +18,7 @@
#define INPUTEVENT_H_
#include
+#include // for translation
#include
#ifndef __linux
@@ -211,6 +212,12 @@ public:
{
return value_ & MODIFIER_MASK;
}
+
+ // We want to enable InputEvent as a translation context, so we fake the tr method:
+ static QString tr(const char* string)
+ {
+ return QCoreApplication::translate("InputEvent", string);
+ }
};
struct SpecialInputEventDescription
diff --git a/src/pvsmgr.cpp b/src/pvsmgr.cpp
index dd00c0e..f543c6d 100644
--- a/src/pvsmgr.cpp
+++ b/src/pvsmgr.cpp
@@ -19,6 +19,7 @@
#include "gui/mainWindow.h"
#include "util/consoleLogger.h"
#include "util/CertManager.h"
+#include "src/input/i18n.h"
QApplication *qtApp;
@@ -35,6 +36,8 @@ int main(int argc, char** argv)
translator.load(":pvsmgr");
qtApp->installTranslator(&translator);
+ USE_PVSINPUT_TRANSLATIONS;
+
ConsoleLog setLogName(QString("log.server"));
ConsoleLog writeLine(QString("PVS-Server started."));
diff --git a/src/pvsmgrtouch.cpp b/src/pvsmgrtouch.cpp
index d14ea56..4a1a97d 100644
--- a/src/pvsmgrtouch.cpp
+++ b/src/pvsmgrtouch.cpp
@@ -18,6 +18,7 @@
#include
#include "util/consoleLogger.h"
#include "util/CertManager.h"
+#include "src/input/i18n.h"
QApplication *qtApp;
@@ -34,6 +35,8 @@ int main(int argc, char** argv)
translator.load(":pvsmgr");
qtApp->installTranslator(&translator);*/
+ USE_PVSINPUT_TRANSLATIONS;
+
ConsoleLog setLogName(QString("log.server"));
ConsoleLog writeLine(QString("PVS-Server started."));
--
cgit v1.2.3-55-g7522