[PyQt] understanding localization

supik supd at wo.cz
Sun Feb 23 07:00:34 GMT 2014


Dne 14.2.2014 22:18, supik napsal(a):
> | Florian Bruhin :
>
> | Please send plain text mails, I'm using a mail client, not a browser.
>
> I'm sorry, my mistake
>
> | Hans-Peter Jansen
> | I guess, you need to create a KApplication object beforehand.
>
> | Pete
>
> Thaks for advice I will try soon
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
hi,
after short vacation I resume with localization testing

very simple program ( wit created KApplication ) again do not work 
correctly ..
-------------------------------------------------------------------------
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os, locale
from PyKDE4.kdeui import *
from PyKDE4.kdecore import *

class MainWindow (KMainWindow):
      def __init__ (self):
           KMainWindow.__init__ (self)
           self.resize (640, 480)

def main():
     appName     = "screencast"
     catalog     = ""
     programName = ki18n ("screencast")
     version     = "1.0"
     description = ki18n ("localization test")
     license     = KAboutData.License_GPL
     copyright   = ki18n ("2014 SupSoft")
     text        = ki18n ("none")
     homePage    = ""
     bugEmail    = "supd at wo.cz"

     aboutData   = KAboutData (appName, catalog, programName, version, 
description,license, copyright, text, homePage, bugEmail)
     KCmdLineArgs.init (sys.argv, aboutData)
     app = KApplication ()
     kde_locale = KGlobal.locale()
     mainWindow = MainWindow ()
     mainWindow.show ()
     app.exec_ ()
     print locale.getlocale()
     print kde_locale.language()

if __name__ == '__main__':
     main()
---------------------------------------

returns
('cs_CZ', 'UTF-8')
en_US
-----------------------------------------

what is wrong ?



More information about the PyQt mailing list