[PyKDE] Localizing PyQt4 application

Ismail Donmez ismail at pardus.org.tr
Mon Dec 4 16:58:54 GMT 2006


Hi,

I have the following code in my app:

class MyApp(QtGui.QApplication):
    def __init__(self):
        QtGui.QApplication.__init__(self,sys.argv)

        self.mainWindow = MainWindow()

        self.translator = QTranslator()
        self.translator.load(("myapp-%s.qm" % 
QLocale.system().name()), "/usr/share/myapp")
        self.installTranslator(self.translator)

        self.mainWindow.show()
        self.exec_()

if __name__ == "__main__":
    MyApp

And 
/usr/share/myapp/myapp-tr_TR.qm file exists. But when I start my app with 
tr_TR locale it still shows English strings. I extracted the strings with 
lupdate4 mainwindow.py -ts myapp.ts . So I wonder if I am doing something 
wrong or maybe I have to re-implement a function?

Regards,
ismail

-- 
A pisi up everyday keeps the bugs away




More information about the PyQt mailing list