[PyKDE] Feedback Needed on Possible tr() Changes

Detlev Offenbach detlev at die-offenbachs.de
Mon May 26 17:33:00 BST 2003


Am Montag, 26. Mai 2003 15:35 schrieb Phil Thompson:
> On Sunday 25 May 2003 9:27 am, Detlev Offenbach wrote:
> > Hi,
> >
> > I would rather leave the implementation as it is right now. It only
> > causes problems, if the subclass doesn't contain any string that
> > needs a translation (i.e. no call to self.tr or self.trUtf8). For
> > these it is reallly easy to include a dummy call in the __init__
> > method [i.e. dummy = self.trUft8("dummy")]. This makes the subclass
> > work as expected and all the translations are there. This is some
> > kind of a workaraound but I think it is less error prone than
> > solution 3. In addition to this solution 3 would need quite a bit of
> > work for porting sources (like eric3) and would probably break
> > compatibility with older PyQt versions.
> >
> > Regards,
> > Detlev
>
> I don't understand how the dummy call makes any difference at all. The
> context is the class name of the instance and so is determined when
> the instance is created. The context of tr()/trUtf8() calls shouldn't
> make any difference.
>
> Phil
>

That was what I observed. I had a subclass that didn't have any 
tr()/trUtf8() calls and I didn't get any translated strings (none of the 
baseclasses translations were shown). However, after inclusion of the 
dummy translation the translations of the baseclass were displayed. I 
have no idea how this happened, but it happened and it still works 
within eric3.

...

Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de




More information about the PyQt mailing list