I believe this to be all that is needed for inserting
keys with Qt frontend.

If I do LANG=ro_RO ./lyx with this patch, I can insert t-cedilla etc.
from latin2, just fine (assuming I've set document lang naturally).

If my LANG=en_GB, X will not let me compose these latin2 cahracters
*anyway*, so I do not see how it is possible to ever insert them.

So, can people comment and test this ? Kornel, I believe that with this
patch, you will be able to insert such characters that you were
previously hacking with ->ascii() for (and I now understand why your
patch works).

I reckon we can fix the menus etc. using the same thing, all we need is
:

QString const _qt(string const & str)
{
        QTextCodec * codec = QTextCodec::codecForLocale();

        return codec->toUnicode(str.c_str());
}

and to use _qt() in all frontends/qt2/. What do people reckon ?

regards
john

p.s. do I have to make install to get i18n in menus etc. ?


Index: QLyXKeySym.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLyXKeySym.C,v
retrieving revision 1.13
diff -u -r1.13 QLyXKeySym.C
--- QLyXKeySym.C        12 Dec 2002 17:12:20 -0000      1.13
+++ QLyXKeySym.C        17 Dec 2002 02:10:38 -0000
@@ -20,6 +20,7 @@
 #include "debug.h"
 
 #include <qevent.h>
+#include <qtextcodec.h>
 
 using std::endl;
 
@@ -83,8 +84,9 @@
 
 char QLyXKeySym::getISOEncoded() const
 {
-       lyxerr[Debug::KEY] << "getISO returning " << text_.latin1()[0] << endl;
-       return text_.latin1()[0];
+       QTextCodec * codec = QTextCodec::codecForLocale();
+       QCString const isostr = codec->fromUnicode(text_);
+       return isostr[0];
 }
 
 

-- 
"ALL television is children's television."
        - Richard Adler 

Reply via email to