[PyKDE] Another translation question

Phil Thompson phil at riverbankcomputing.co.uk
Wed Jul 5 17:28:59 BST 2006


On Thursday 29 June 2006 11:49 pm, Andreas Pakulat wrote:
> On 30.06.06 00:24:10, Andreas Pakulat wrote:
> > just had a look at generated code from pyuic4 and I'm curious:
> >
> > Shouldn't pyuic4 use
> > QtCore.QCoreApplication.translate(classname.objectName(), <somestring>)
> > in retranslateUi(self, classname)?
>
> Turns out it already does by redefining self.tr, however it's not
> completely right, because it uses self.uiname, which is the objectName
> of the class created.
>
> The attached classes uses self.toplevelWidget.uiclass for the context
> parameter. This makes translation of generated python code working and
> by this "workaround" you can translate ui-forms.

Sorry for taking so long to get around to this...

Can you remind me what problem this is trying to fix?

Isn't changing the context name going to create problems sharing translations 
between C++ and Python code?

Phil




More information about the PyQt mailing list