[PyKDE] tr() and other stuff
Jim Bublitz
jbublitz at nwinternet.com
Sun Dec 9 19:57:24 GMT 2001
A few days ago I posted a bug report regarding the methods
tr(const char *) and tr(const char *, const char *). With out a
long explanation, there are three reasonable ways to handle these
methods:
1. Don't implement them
2. Have tr (const char *c) return QString::fromlatin1 (c) (do
essentially nothing)
3. Have tr (const char *c) return QObject::tr (c) (static method)
Note that for the last two cases, you can implement this behavior
yourself if you really want it. PyKDE2 does (1) - the tr methods
are NOT implemented. This is essentially the intent of the KDE
project, which uses the i18n functions for translation. The i18n
functions are available in PyKDE2 in the kdecore module. The PyKDE2
docs will be updated to reflect this. This is (for the moment) the
final fix. None of this affects PyQt or using tr() with PyQt.
This turns out to NOT be a sip problem, and I don't expect sip will
be modified to accomplish this (it would require an ugly hack for a
very special case - not a good thing). Although this is related to
the use of QT_NO_TRANSLATION which Phil will probably modify sip to
handle (for Qt/E), a QT_NO_TRANSLATION fix will NOT solve the tr()
problem in PyKDE2 - it's a different set of issues.
With that problem resolved, PyKDE2-3.0alpha3 now compiles and
installs. It supports KDE through 2.2.0, and will in fact compile
against KDE2.2.1 (tested) and probably KDE2.2.2 (not tested). I
have code to write to complete about a dozen files (new stuff in
KDE2.2.0) and some cleanup to do before this is ready for release.
I expect it will be on CVS in a few days and available as a tarball
shortly after that. There will be an additonal release(s) for
KDE2.2.1/KDE2.2.2, but I don't expect a lot of changes for those.
KDE3.0 bindings will probably be available after KDE3.0beta1 is
released, which probably isn't too far away now.
Similar to PyQt, there will be a tarball specifically for KDE2.1.x
and a different tarball specifically for KDE2.2.x, so be sure to
choose the correct version.
Jim
More information about the PyQt
mailing list