[PyKDE] Localizing PyQt4 application

Andreas Pakulat apaku at gmx.de
Mon Dec 4 17:26:47 GMT 2006


On 04.12.06 18:58:54, Ismail Donmez wrote:
> 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?

Works fine for me, did you translate all the strings using qt4's linguist? 

Andreas

-- 
You fill a much-needed gap.




More information about the PyQt mailing list