4 Oct 20:29
Internationalization and PyQt
From: Thorsten Kampe <thorsten <at> thorstenkampe.de>
Subject: Internationalization and PyQt
Newsgroups: gmane.comp.python.pyqt-pykde
Date: 2008-10-04 18:31:10 GMT
Subject: Internationalization and PyQt
Newsgroups: gmane.comp.python.pyqt-pykde
Date: 2008-10-04 18:31:10 GMT
Hi,
I've "upgraded" a PyQt demo application of mine so it includes not only
a translation of the user interface in German but also in French.
My problem is that it simply works but I think it shouldn't (no don't
laugh). This is the code in my demo application (called my_application)
that does the internationalization:
# Internationalization
qtTranslator = QtCore.QTranslator()
qtTranslator.load(':/qt.qm')
app.installTranslator(qtTranslator)
appTranslator = QtCore.QTranslator()
appTranslator.load(':/my_application.qm')
app.installTranslator(appTranslator)
#
This is the relevant snippet from my_application.qrc:
<qresource lang="de">
<file alias="my_application.qm">translation/my_application_de.qm</file>
<file alias="qt.qm">translation/qt_de.qm</file>
</qresource>
<qresource lang="fr">
<file alias="my_application.qm">translation/my_application_fr.qm</file>
<file alias="qt.qm">translation/qt_fr.qm</file>
Please note that I'm using the same alias ("my_application.qm" and
(Continue reading)
RSS Feed