-rw-r--r-- | core/launcher/startmenu.cpp | 17 | ||||
-rw-r--r-- | core/launcher/systray.cpp | 17 |
2 files changed, 18 insertions, 16 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index 917f4c1..7373ea8 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp @@ -313,4 +313,5 @@ void StartMenu::loadApplets() QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); + QString lang = getenv( "LANG" ); QString path = QPEApplication::qpeDir() + "/plugins/applets"; QDir dir( path, "lib*.so" ); @@ -329,4 +330,12 @@ void StartMenu::loadApplets() applet->library = lib; applet->iface = iface; + + QTranslator *trans = new QTranslator(qApp); + QString type = (*it).left( (*it).find(".") ); + QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; + if ( trans->load( tfn )) + qApp->installTranslator( trans ); + else + delete trans; } else { exclude += *it; @@ -343,12 +352,4 @@ void StartMenu::loadApplets() while (napplets--) { MenuApplet *applet = xapplets[napplets]; - QString lang = getenv( "LANG" ); - QTranslator * trans = new QTranslator(qApp); - QString type = (*it).left( (*it).find(".") ); - QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; - if ( trans->load( tfn )) - qApp->installTranslator( trans ); - else - delete trans; applet-> popup = applet-> iface-> popup ( this ); diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 406c662..4859e48 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp @@ -92,4 +92,5 @@ void SysTray::addApplets() QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); + QString lang = getenv( "LANG" ); QString path = QPEApplication::qpeDir() + "/plugins/applets"; QDir dir( path, "lib*.so" ); @@ -108,4 +109,12 @@ void SysTray::addApplets() applet->library = lib; applet->iface = iface; + + QTranslator *trans = new QTranslator(qApp); + QString type = (*it).left( (*it).find(".") ); + QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; + if ( trans->load( tfn )) + qApp->installTranslator( trans ); + else + delete trans; } else { exclude += *it; @@ -119,12 +128,4 @@ void SysTray::addApplets() applet->applet = applet->iface->applet( this ); appletList.append(*applet); - QString lang = getenv( "LANG" ); - QTranslator * trans = new QTranslator(qApp); - QString type = (*it).left( (*it).find(".") ); - QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; - if ( trans->load( tfn )) - qApp->installTranslator( trans ); - else - delete trans; } delete applets; |