[PyKDE] Re: Translation Recomendations

David Sankel camior at gmail.com
Mon Jan 3 17:35:24 GMT 2005


On Mon, 3 Jan 2005 18:28:21 +0100, David Sankel <camior at gmail.com> wrote:
> Loading the translations:
>   def loadTranslations():
>     """Load translation files into QApplication.  They are loaded based on the
>        locale of the host system."""
>     # locale = "es" # Spanish Locale
>     locale = QTextCodec.locale()
>     # There are two translation files for each locale.  The first for files
>     # generated with qdesigner and the second for python code.
>     filePrefixes = [ "translations/Translation_",
> "translations/Translation_Python_" ]
>     for prefix in filePrefixes:
>       translator = QTranslator(qApp)
Sorry, forgot the important
      translator.load( prefix + locale, '.')

>       qApp.installTranslator( translator )




More information about the PyQt mailing list