[PyQt] Fwd: translation of ui
lunaryorn at googlemail.com
Fri Jul 1 10:17:30 BST 2011
2011/7/1 Yaşar Arabacı <yasar11732 at gmail.com>:
> Thanks, appearantly I also needed to create a .pro file for pylupdate to
> know which files to convert to.
Alternatively you can specifiy the files to translate and the
translations to update on the command line:
pylupdate4 <ui_files> <python_files> -ts <translation_files>
> I created a language file and translated it, but how would my application use that translation file?
Use "lrelease" from Qt  to compile the translations, and deploy the
compiled translations along with your program. In your program you
need to create a "QTranslator"  to load these compiled
translations. There a different ways of deploying the translations
(e.g. as distutils package data), but the easiest is probably to
include them as resource (using "pyrcc4").
You should read the "Qt Linguist" manual , which describes the Qt
translation process in detail, and the corresponding chapter in the
PyQt Reference Guide , which describes the PyQt specific
differences to this process.
More information about the PyQt