[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: lancelot launcher + part untranslated in branch + trunk
From:       Burkhard =?iso-8859-15?q?L=FCck?= <lueck () hube-lueck ! de>
Date:       2009-04-30 14:48:23
Message-ID: 200904301648.23357.lueck () hube-lueck ! de
[Download RAW message or body]

Am Donnerstag 30 April 2009 00:19:18 schrieb Albert Astals Cid:
> A Dimecres, 29 d'abril de 2009, Burkhard Lück va escriure:
> > Hi,
> >
> > in kdeplasma-addons/applets/lancelot all messages are extracted properly
> > to the catalog lancelot.
> >
> > But these translations are not used by lancelot launcher nor lancelot
> > part.
> >
> > LancelotApplication.cpp has a setMainCatalog("lancelot") call, but this
> > does not work.
> >
> > launcher/LancelotApplet.h has K_EXPORT_PLASMA_APPLET(lancelot-launcher,
> > ...), so renaming the catalog lancelot to plasma_applet_lancelot-launcher
> > pulls in all translation for lancelot launcher .
> >
> > In the attached patch for branch I have removed the useless
> > setMainCatalog() call in LancelotApplication.cpp and added a
> > setMainCatalog() call for the lancelot part.
> >
> > With this patch and "move messages/kdeplasma-addons/lancelot
> > messages/kdeplasma-addons/plasma_applet_lancelot-launcher.po"
> > lancelot launcher + part are fully translated here.
> >
> > It's not much time to fix this for 4.2.3!
> >
> > Commit the patch and rename the catalog?
>
> Arggg, didn't see that, won't make if for 4.2.3, renaming in this stage is
> so dangerous, tried to use insertCatalog instead setMainCatalog? That
> should work without involving renaming catalogs, if you can try it and
> commit it before tag it would be good.
>
Sorry, I could not fix this so far, because I did not understand the i18n bugs 
in lancelot completely until now.

In recent svn we have so far:
* one catalog "lancelot" with all messages for lancelot part + launcher
* lancelot part pulls the translation from the non existing 
catalog "plasma_applet_lancelot-part"
* lancelot launcher pulls the translation from two different catalogs, 
from "lancelot" and from the non existing 
catalog "plasma_applet_lancelot-launcher".
The "Menu" page of the settings get the translation from both catalogs, this 
depends on the way you open this page.
That's the weirdest i18n behaviour I've ever found...

With the attached patch (some additional insertCatalog calls) lancelot 
launcher and lancelot part are translated here without renaming the 
catalog "lancelot".
(The patch in LancelotWindow.cpp makes the action names in the "Configure 
Shortcuts" dialog of lancelot translatable)
Could someone give it a try?

Btw plasma seems to have another i18n bug, the category names ("Application 
Launchers", "Astronomy") in the drop down box of the "Add Widget" dialog are 
untranslatable?

-- 
Burkhard Lück


["lancelot.patch" (text/x-diff)]

Index: kdeplasma-addons/applets/lancelot/app/src/parts/LancelotPart.cpp
===================================================================
--- kdeplasma-addons/applets/lancelot/app/src/parts/LancelotPart.cpp	(Revision 961622)
+++ kdeplasma-addons/applets/lancelot/app/src/parts/LancelotPart.cpp	(Arbeitskopie)
@@ -295,6 +295,7 @@
 
     resize(size());
     m_layout->activate();
+    KGlobal::locale()->insertCatalog("lancelot");
 }
 
 bool LancelotPart::load(const QString & input)
Index: kdeplasma-addons/applets/lancelot/app/src/launcher/LancelotApplet.cpp
===================================================================
--- kdeplasma-addons/applets/lancelot/app/src/launcher/LancelotApplet.cpp	(Revision 961622)
+++ kdeplasma-addons/applets/lancelot/app/src/launcher/LancelotApplet.cpp	(Arbeitskopie)
@@ -239,6 +239,7 @@
         & d->signalMapperToggle, SIGNAL(mapped(const QString &)),
         this, SLOT(toggleLancelotSection(const QString &))
     );
+    KGlobal::locale()->insertCatalog("lancelot");
 }
 
 void LancelotApplet::showLancelot()
Index: kdeplasma-addons/applets/lancelot/app/src/LancelotApplication.cpp
===================================================================
--- kdeplasma-addons/applets/lancelot/app/src/LancelotApplication.cpp	(Revision 961622)
+++ kdeplasma-addons/applets/lancelot/app/src/LancelotApplication.cpp	(Arbeitskopie)
@@ -90,8 +90,6 @@
 
 int LancelotApplication::main(int argc, char **argv)
 {
-    KLocale::setMainCatalog("lancelot");
-
     KAboutData * about = new AboutData();
     KCmdLineArgs::init(argc, argv, about);
 
Index: kdeplasma-addons/applets/lancelot/app/src/LancelotWindow.cpp
===================================================================
--- kdeplasma-addons/applets/lancelot/app/src/LancelotWindow.cpp	(Revision 961622)
+++ kdeplasma-addons/applets/lancelot/app/src/LancelotWindow.cpp	(Arbeitskopie)
@@ -446,7 +446,7 @@
 QStringList LancelotWindow::sectionNames()
 {
     QStringList res;
-    res << "Applications" << "Computer" << "Contacts" << "Documents";
+    res << i18n("Applications") << i18n("Computer") << i18n("Contacts") << i18n("Documents");
     return res;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic