[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] QTranslator not working at all?
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2006-06-29 9:22:00
Message-ID: 20060629092200.GA9265 () morpheus ! apaku ! dnsalias ! org
[Download RAW message or body]

On 29.06.06 11:04:49, Andreas Pakulat wrote:
> Hi,
> 
> I've got a small problem here with QTranslator: It doesn't work.
> 
> I attached the .ts and .qm files for reference, with those the following
> code snippet returns an empty string:
> 
> >>> from PyQt4 import QtCore
> >>> app=QtCore.QCoreApplication()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: insufficient number of arguments to QCoreApplication()
> >>> import sys
> >>> import os
> >>> app=QtCore.QCoreApplication(sys.argv)
> >>> qtrans = QtCore.QTranslator()
> >>> qtrans.load("xpathevaluator_de", os.getcwd() )
> True
> >>> qtrans.translate('BasicModel','Node')
> <PyQt4.QtCore.QString object at 0xb7c7f4ec>
> >>> print "'%s'" %qtrans.translate('BasicModel','Node')
> ''
> 
> Anybody got ideas? However the i18n example works perfectly..

As you can see in the ts-file some program (I don't know which it might
have been) added the obsolete type to all strings. While I'm not getting
the correct string from the above script (the translation for Node), it
doesn't work in the real application. I think that is due to the
context-problem and I will look into that later. If I can't find a
solution I'll be back ;-)

Andreas

-- 
Your lucky color has faded.

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic