[PyQt] understanding localization

Hans-Peter Jansen hpj at urpla.net
Fri Feb 14 11:35:47 GMT 2014


If you really intent to receive help, don't send such HTML mails to the ML!

On Freitag, 14. Februar 2014 08:58:53 MILAN UHRÁK wrote:
> Hi all !
> as I'm new in  PyQt, I cannot understand which way program become localized.
> My first program does not work quite correctly and I'm not sure why. 
> Maybe first queston is about this :
>  
> Simple program
> from PyKDE4 import kdecore
>
>  
> def main():
>     kde_locale = kdecore.KGlobal.locale()
>     print kde_locale.language()
>  
> ### return "en_US"

I guess, you need to create a KApplication object beforehand.

Pete

>     print locale.getlocale()
>  
> ### return "('cs_CZ', 'UTF-8')"
> ---------------------------------------
>  
>  
> but my enviroment is cs_CZ.
>  
> using python 2.7.7,  qt 4.8.5, openSuSE 13.1
>  
> how can I achieve to pyqt will know my locale setting ? What i must to do ?
>  
> my amateur attempts not work :
>  
> kde_locale.setLanguage( "cs" )  - does not  effect
>  
> kde_locale.setLanguage( QString("cs") )  - has effect - sigsegv
>  
> thanks for any help



More information about the PyQt mailing list