--WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On 30.06.06 00:24:10, Andreas Pakulat wrote: > just had a look at generated code from pyuic4 and I'm curious: > > Shouldn't pyuic4 use > QtCore.QCoreApplication.translate(classname.objectName(), ) > in retranslateUi(self, classname)? Turns out it already does by redefining self.tr, however it's not completely right, because it uses self.uiname, which is the objectName of the class created. The attached classes uses self.toplevelWidget.uiclass for the context parameter. This makes translation of generated python code working and by this "workaround" you can translate ui-forms. Andreas -- Never reveal your best argument. --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch_fix_pyuic4_tr --- PyQt-x11-gpl-4.0/pyuic/uic/Compiler/compiler.py 2006-06-10 14:43:21.000000000 +0200 +++ PyQt-x11-gpl-4.0.fixpyuic4/pyuic/uic/Compiler/compiler.py 2006-06-30 00:46:11.000000000 +0200 @@ -54,7 +54,7 @@ \treturn QtGui.QApplication.translate("%s", string, None, QtGui.QApplication.UnicodeUTF8) def retranslateUi(self, %s): -""" % (self.translator.split(".")[-1], self.uiname, self.uiname)) +""" % (self.translator.split(".")[-1], self.toplevelWidget.uiclass, self.uiname)) indenter.indent() indenter.write("\n".join(qtproxies.i18n_strings)) indenter.dedent() --WIyZ46R2i8wDzkSu Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde --WIyZ46R2i8wDzkSu--