On Tue, Dec 17, 2002 at 02:17:34AM +0000, John Levon wrote:
> I reckon we can fix the menus etc. using the same thing, all we need is
Here's a proof-of-concept. LANG=pl_PL menus are correct with the below
patch, wrong without.
Lars, comments ? Do people agree this is a sensible (albeit temporary)
solution ?
Of course, we would have to :
o fix UI extraction
o audit and fix all dialog setting text
but I think it's definitely worth doing.
regards
john
Index: QLPopupMenu.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLPopupMenu.C,v
retrieving revision 1.10
diff -u -r1.10 QLPopupMenu.C
--- QLPopupMenu.C 27 Nov 2002 10:30:23 -0000 1.10
+++ QLPopupMenu.C 17 Dec 2002 02:34:26 -0000
@@ -24,8 +24,11 @@
#include "QLPopupMenu.h"
+#include <qtextcodec.h>
+
#include <boost/scoped_ptr.hpp>
+using std::endl;
using std::pair;
using std::make_pair;
@@ -72,7 +75,7 @@
{
// FIXME: leaks ??
QLPopupMenu * pm = new QLPopupMenu(owner, item->submenuname(), is_toplevel);
- int id = parent->insertItem(getLabel(*item).c_str(), pm);
+ int id =
+parent->insertItem(QTextCodec::codecForLocale()->toUnicode(getLabel(*item).c_str()),
+pm);
return make_pair(id, pm);
}
@@ -127,7 +130,7 @@
owner_->view()->getLyXFunc().getStatus(m->action());
if (status.disabled() && m->optional())
continue;
- insertItem(getLabel(*m).c_str(), m->action());
+
+insertItem(QTextCodec::codecForLocale()->toUnicode(getLabel(*m).c_str()),
+m->action());
setItemEnabled(m->action(), !status.disabled());
setItemChecked(m->action(), status.onoff(true));
}