Commit 78bbc355 authored by Burkhard Lück's avatar Burkhard Lück
Browse files

fix i18n bug in world clock

BUG:182650

svn path=/branches/KDE/4.3/kdeedu/marble/; revision=991009
parent 7a2bb2c9
......@@ -63,6 +63,7 @@ WorldClock::WorldClock(QObject *parent, const QVariantList &args)
{
KGlobal::locale()->insertCatalog("marble");
KGlobal::locale()->insertCatalog("marble_qt");
KGlobal::locale()->insertCatalog("timezones4");
setHasConfigurationInterface(true);
setAcceptHoverEvents(true);
//The applet needs a 2:1 ratio
......@@ -136,6 +137,8 @@ void WorldClock::init()
m_lastRect = QRect(0,0,0,0);
m_showDate = cg.readEntry("showdate", false);
setTz( getZone() );
Plasma::DataEngine *m_timeEngine = dataEngine("time");
m_timeEngine->connectSource( "Local", this, 6000, Plasma::AlignToMinute);
}
......@@ -234,10 +237,11 @@ QString WorldClock::getZone()
qreal lat, lon;
bool ok = m_map->viewParams()->viewport()->currentProjection()->geoCoordinates(
m_hover.x(), m_hover.y(), m_map->viewParams()->viewport(), lon, lat );
if( !ok )
return KSystemTimeZones::local().name();
QString timezone;
if( !ok ) {
timezone = KSystemTimeZones::local().name();
return i18n( timezone.toUtf8().data() );
}
QList<QString> zones = m_locations.keys();
QString closest;
......@@ -251,7 +255,8 @@ QString WorldClock::getZone()
closest = zones.at( i );
}
}
return m_locations.value( closest ).name();
timezone = m_locations.value( closest ).name();
return i18n( timezone.toUtf8().data() );
}
void WorldClock::setTz( QString newtz )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment