[PyQt] Translating from a function

Baz Walter bazwal at ftml.net
Wed Sep 29 17:22:54 BST 2010


On 29/09/10 15:19, Eric Frederich wrote:
> I have a bunch of helper functions that raise exceptions and I'd like the
> messages in those exceptions to be translated.
> How should I get those strings translated?
> QObject.tr is not a static method, I can't just call it.
> I need a QObject don't I?

QCoreApplication has the static method "translate":

   http://doc.qt.nokia.com/4.6/qcoreapplication.html#translate


More information about the PyQt mailing list