[PyQt] Translation of strings with Python formating

Nahuel Defossé nahuel.defosse at gmail.com
Mon Jan 3 22:39:33 GMT 2011


Hi

I've noticed that both QObject.trUtf8 and QObject.tr do not return
Python strings, what is rather unconvinient when using the % operator
to format strings.
I prefer str % operator since it accepts keyword arguments, something
that is not that simple QString.arg method.

What is your advice to get unicode or str from QObject.tr? I tried to
implement QApplication.translate, QApplication.tr and
QApplication.trUtf8 with no
results whether I used the staticmethod decorator or not.

Thanks
Nahuel


More information about the PyQt mailing list