summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libsowatch/allwatchscanner.cpp4
-rw-r--r--libsowatch/allwatchscanner.h2
-rw-r--r--libsowatch/libsowatch.pro7
-rw-r--r--libsowatch/libsowatch_en.ts31
-rw-r--r--libsowatch/libsowatch_es.ts31
-rw-r--r--libsowatch/sowatch_global.h21
-rw-r--r--metawatch/metawatchdigital.cpp6
-rw-r--r--metawatch/res/graphics/idle_gmail.bmpbin134 -> 0 bytes
-rw-r--r--metawatch/res/graphics/idle_mail.bmpbin0 -> 134 bytes
-rw-r--r--metawatch/res/graphics/idle_msg.bmpbin0 -> 134 bytes
-rw-r--r--metawatch/res/graphics/idle_sms.bmpbin134 -> 0 bytes
-rw-r--r--sowatchd/main.cpp27
12 files changed, 115 insertions, 14 deletions
diff --git a/libsowatch/allwatchscanner.cpp b/libsowatch/allwatchscanner.cpp
index 8a49b86..97f8454 100644
--- a/libsowatch/allwatchscanner.cpp
+++ b/libsowatch/allwatchscanner.cpp
@@ -1,3 +1,7 @@
+#include <QtCore/QDebug>
+
+#include "registry.h"
+#include "watchplugininterface.h"
#include "allwatchscanner.h"
using namespace sowatch;
diff --git a/libsowatch/allwatchscanner.h b/libsowatch/allwatchscanner.h
index ac0baae..561c6a8 100644
--- a/libsowatch/allwatchscanner.h
+++ b/libsowatch/allwatchscanner.h
@@ -4,7 +4,7 @@
#include <QtCore/QObject>
#include <QtCore/QList>
-#include <sowatch.h>
+#include "watchscanner.h"
namespace sowatch
{
diff --git a/libsowatch/libsowatch.pro b/libsowatch/libsowatch.pro
index 59f2eee..ce0468e 100644
--- a/libsowatch/libsowatch.pro
+++ b/libsowatch/libsowatch.pro
@@ -59,13 +59,18 @@ HEADERS += \
gconfkey.h \
notificationsmodel.h
+TRANSLATIONS += libsowatch_en.ts libsowatch_es.ts
+
install_headers.files = $$HEADERS
+install_translations.files = libsowatch*.qm
install_headers.path = /usr/include/sowatch
!isEmpty(MEEGO_VERSION_MAJOR)|maemo5 {
target.path = /opt/sowatch/lib
+ install_translations.path = /opt/sowatch/i18n
} else {
target.path = /usr/lib
+ install_translations.path = /usr/share/sowatch/i18n
}
-INSTALLS += install_headers target
+INSTALLS += install_headers install_translations target
diff --git a/libsowatch/libsowatch_en.ts b/libsowatch/libsowatch_en.ts
new file mode 100644
index 0000000..eb24692
--- /dev/null
+++ b/libsowatch/libsowatch_en.ts
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>sowatch::Notification</name>
+ <message numerus="yes">
+ <location filename="notification.cpp" line="21"/>
+ <source>%n second(s) ago</source>
+ <translation>
+ <numerusform>%n second ago</numerusform>
+ <numerusform>%n seconds ago</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <location filename="notification.cpp" line="24"/>
+ <source>%n minute(s) ago</source>
+ <translation>
+ <numerusform>%n minute ago</numerusform>
+ <numerusform>%n minutes ago</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <location filename="notification.cpp" line="27"/>
+ <source>%n hour(s) ago</source>
+ <translation>
+ <numerusform>%n hour ago</numerusform>
+ <numerusform>%n hours ago</numerusform>
+ </translation>
+ </message>
+</context>
+</TS>
diff --git a/libsowatch/libsowatch_es.ts b/libsowatch/libsowatch_es.ts
new file mode 100644
index 0000000..2d19ef2
--- /dev/null
+++ b/libsowatch/libsowatch_es.ts
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="es_ES">
+<context>
+ <name>sowatch::Notification</name>
+ <message numerus="yes">
+ <location filename="notification.cpp" line="21"/>
+ <source>%n second(s) ago</source>
+ <translation>
+ <numerusform>hace %n segundo</numerusform>
+ <numerusform>hace %n segundos</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <location filename="notification.cpp" line="24"/>
+ <source>%n minute(s) ago</source>
+ <translation>
+ <numerusform>hace %n minuto</numerusform>
+ <numerusform>hace %n minutos</numerusform>
+ </translation>
+ </message>
+ <message numerus="yes">
+ <location filename="notification.cpp" line="27"/>
+ <source>%n hour(s) ago</source>
+ <translation>
+ <numerusform>hace %n hora</numerusform>
+ <numerusform>hace %n horas</numerusform>
+ </translation>
+ </message>
+</context>
+</TS>
diff --git a/libsowatch/sowatch_global.h b/libsowatch/sowatch_global.h
index b537930..3e2f795 100644
--- a/libsowatch/sowatch_global.h
+++ b/libsowatch/sowatch_global.h
@@ -11,17 +11,20 @@
#endif
#if defined(QT_SIMULATOR) || (!defined(MEEGO_VERSION_MAJOR) && !defined(Q_WS_MAEMO_5) && !defined(QT_NO_DEBUG))
-# define SOWATCH_PLUGINS_DIR ".."
-# define SOWATCH_RESOURCES_DIR ".."
-# define SOWATCH_QML_DIR ".."
+# define SOWATCH_PLUGINS_DIR ".."
+# define SOWATCH_RESOURCES_DIR ".."
+# define SOWATCH_QML_DIR ".."
+# define SOWATCH_I18N_DIR ".."
#elif defined(MEEGO_VERSION_MAJOR) || defined(Q_WS_MAEMO_5)
-# define SOWATCH_PLUGINS_DIR "/opt/sowatch/lib"
-# define SOWATCH_RESOURCES_DIR "/opt/sowatch/share"
-# define SOWATCH_QML_DIR "/opt/sowatch/qml"
+# define SOWATCH_PLUGINS_DIR "/opt/sowatch/lib"
+# define SOWATCH_RESOURCES_DIR "/opt/sowatch/share"
+# define SOWATCH_QML_DIR "/opt/sowatch/qml"
+# define SOWATCH_I18N_DIR "/opt/sowatch/i18n"
#elif defined(Q_OS_LINUX)
-# define SOWATCH_PLUGINS_DIR "/usr/lib/sowatch"
-# define SOWATCH_RESOURCES_DIR "/usr/share/sowatch"
-# define SOWATCH_QML_DIR SOWATCH_RESOURCES_DIR "/qml"
+# define SOWATCH_PLUGINS_DIR "/usr/lib/sowatch"
+# define SOWATCH_RESOURCES_DIR "/usr/share/sowatch"
+# define SOWATCH_QML_DIR SOWATCH_RESOURCES_DIR "/qml"
+# define SOWATCH_I18N_DIR SOWATCH_RESOURCES_DIR "/i18n"
#else
# error Please define the paths for your platform
#endif
diff --git a/metawatch/metawatchdigital.cpp b/metawatch/metawatchdigital.cpp
index 3029613..abe47a9 100644
--- a/metawatch/metawatchdigital.cpp
+++ b/metawatch/metawatchdigital.cpp
@@ -144,8 +144,8 @@ void MetaWatchDigital::clear(Mode mode, bool black)
void MetaWatchDigital::renderIdleScreen()
{
QImage idle_call(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_call.bmp"));
- QImage idle_sms(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_sms.bmp"));
- QImage idle_mail(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_gmail.bmp"));
+ QImage idle_msg(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_msg.bmp"));
+ QImage idle_mail(QString(SOWATCH_RESOURCES_DIR "/metawatch/graphics/idle_mail.bmp"));
QPainter p;
_paintMode = IdleMode;
@@ -158,7 +158,7 @@ void MetaWatchDigital::renderIdleScreen()
p.drawLine(1, systemAreaHeight * 2 + 4, screenWidth - 2, systemAreaHeight * 2 + 4);
p.drawImage((32 * 0) + 4, systemAreaHeight * 2 + 7, idle_call);
- p.drawImage((32 * 1) + 4, systemAreaHeight * 2 + 7, idle_sms);
+ p.drawImage((32 * 1) + 4, systemAreaHeight * 2 + 7, idle_msg);
p.drawImage((32 * 2) + 4, systemAreaHeight * 2 + 7, idle_mail);
p.end();
diff --git a/metawatch/res/graphics/idle_gmail.bmp b/metawatch/res/graphics/idle_gmail.bmp
deleted file mode 100644
index fd129b0..0000000
--- a/metawatch/res/graphics/idle_gmail.bmp
+++ /dev/null
Binary files differ
diff --git a/metawatch/res/graphics/idle_mail.bmp b/metawatch/res/graphics/idle_mail.bmp
new file mode 100644
index 0000000..253b5bf
--- /dev/null
+++ b/metawatch/res/graphics/idle_mail.bmp
Binary files differ
diff --git a/metawatch/res/graphics/idle_msg.bmp b/metawatch/res/graphics/idle_msg.bmp
new file mode 100644
index 0000000..5eada49
--- /dev/null
+++ b/metawatch/res/graphics/idle_msg.bmp
Binary files differ
diff --git a/metawatch/res/graphics/idle_sms.bmp b/metawatch/res/graphics/idle_sms.bmp
deleted file mode 100644
index 095ca62..0000000
--- a/metawatch/res/graphics/idle_sms.bmp
+++ /dev/null
Binary files differ
diff --git a/sowatchd/main.cpp b/sowatchd/main.cpp
index 67ed7ac..1fd1789 100644
--- a/sowatchd/main.cpp
+++ b/sowatchd/main.cpp
@@ -1,4 +1,5 @@
#include <QtCore/QDebug>
+#include <QtCore/QTranslator>
#include <QtGui/QApplication>
#include <QtDBus/QDBusConnection>
@@ -13,6 +14,30 @@ namespace sowatch
using namespace sowatch;
+static void setupLocalization(QApplication *app)
+{
+ const QString locale(QLocale::system().name());
+ QTranslator *translator;
+
+ // Set up main Qt translator first
+ translator = new QTranslator(app);
+ if (translator->load("qt_" + locale,
+ QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
+ app->installTranslator(translator);
+ } else {
+ delete translator;
+ qWarning() << "Could not load Qt translation for" << locale;
+ }
+
+ // Set up libsowatch translator
+ translator = new QTranslator(app);
+ if (translator->load("libsowatch_" + locale, SOWATCH_I18N_DIR)) {
+ app->installTranslator(translator);
+ } else {
+ qWarning() << "Could not load translation for" << locale;
+ }
+}
+
int main(int argc, char *argv[])
{
// Some plugins use QtGui functionality, so QApplication must be used
@@ -23,6 +48,8 @@ int main(int argc, char *argv[])
QApplication::setApplicationName("sowatchd");
QApplication::setQuitOnLastWindowClosed(false);
+ setupLocalization(&app);
+
sowatch::daemon = new Daemon(&app);
new DaemonAdaptor(sowatch::daemon);