[PyQt] Using self.tr() with python string formatting

Vincent Vande Vyvre vincent.vandevyvre at swing.be
Fri Aug 3 12:49:17 BST 2012


On 03/08/12 12:55, Itay Brandes wrote:
> right now for using self.tr <http://self.tr>() with python string
> formatting, i do the following thing:
>
> unicode(self.tr <http://self.tr>("%d out of %d completed")) % (i, n)
>
> is there a way to somehow combine the unicode & self.tr
> <http://self.tr>, or make them look shorter?
> because calling unicode(self.tr <http://self.tr>()) on every shown
> string makes a lot of code noise
>
> Thanks.
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
self.trUtf8() no ?

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qobject.html#trUtf8

-- 
Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>



More information about the PyQt mailing list