summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebookevent.cpp4
-rw-r--r--core/pim/today/today.cpp25
2 files changed, 24 insertions, 5 deletions
diff --git a/core/pim/today/plugins/datebook/datebookevent.cpp b/core/pim/today/plugins/datebook/datebookevent.cpp
index 48f204e..3c1e97a 100644
--- a/core/pim/today/plugins/datebook/datebookevent.cpp
+++ b/core/pim/today/plugins/datebook/datebookevent.cpp
@@ -43,9 +43,9 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
ampm = config.readBoolEntry( "AMPM", TRUE );
msg += "<B>" + (ev).description() + "</B>";
if ( (ev).event().hasAlarm() ) {
- msg += " <b>[with alarm]</b>";
+ msg += " <b>" + tr("[with alarm]") +"</b>";
}
// include location or not
if ( show_location ) {
@@ -66,9 +66,9 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
}
// include possible note or not
if ( show_notes ) {
- msg += "<br> <i>note</i>:" +( (ev).notes() ).mid( 0, maxCharClip );
+ msg += "<br> <i>" + tr("note") + "</i>:" +( (ev).notes() ).mid( 0, maxCharClip );
}
setText( msg );
connect( this, SIGNAL( clicked() ), this, SLOT( editMe() ) );
}
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 2f6907d..2497ee1 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -14,8 +14,11 @@
* *
***************************************************************************/
+
+#define QTOPIA_INTERNAL_LANGLIST
+
#include "today.h"
#include <opie/todayconfigwidget.h>
#include <qpe/config.h>
@@ -35,9 +38,9 @@
#include <qhbox.h>
#include <opie/otabwidget.h>
#include <qdialog.h>
#include <qwhatsthis.h>
-
+#include <qtranslator.h>
struct TodayPlugin {
TodayPlugin() : library( 0 ), iface( 0 ), guiPart( 0 ), guiBox( 0 ) {}
QLibrary *library;
@@ -160,10 +163,10 @@ void Today::loadPlugins() {
if ( !pluginList.isEmpty() ) {
for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
(*tit).guiBox->hide();
(*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
- (*tit).library->unload();
delete (*tit).guiBox;
+ (*tit).library->unload();
delete (*tit).library;
}
pluginList.clear();
}
@@ -189,8 +192,22 @@ void Today::loadPlugins() {
plugin.library = lib;
plugin.iface = iface;
plugin.name = QString(*it);
+ QString type = (*it).left( (*it).find(".") );
+ QStringList langs = Global::languageList();
+ for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) {
+ QString lang = *lit;
+ qDebug( "Languages: " + lang );
+ QTranslator * trans = new QTranslator( qApp );
+ QString tfn = QPEApplication::qpeDir()+"/i18n/" + lang + "/" + type + ".qm";
+ if ( trans->load( tfn ) ) {
+ qApp->installTranslator( trans );
+ } else {
+ delete trans;
+ }
+ }
+
// find out if plugins should be shown
if ( m_excludeApplets.grep( *it ).isEmpty() ) {
plugin.active = true;
} else {
@@ -302,8 +319,9 @@ void Today::draw() {
void Today::startConfig() {
// disconnect timer to prevent problems while being on config dialog
disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
+ m_refreshTimer->stop( );
TodayConfig conf( this, "dialog", true );
TodayPlugin plugin;
@@ -333,9 +351,10 @@ void Today::startConfig() {
}
loadPlugins();
} else {
// since refresh is not called in that case , reconnect the signal
- connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
+ m_refreshTimer->start( 15000 ); // get the config value in here later
+ connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) );
}
}