Try to fix GMenubar for UTF-8 locales

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13213 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Spray 2006-02-12 15:53:56 +00:00
parent b6ab9d8886
commit 45bd72333f
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
2006-02-12 John Spray <spray@lyx.org>
* GMenubar.C: assume backend strings in latin1 (bug 1954)
2006-02-09 John Spray <spray@lyx.org>
* GPreferences.[Ch], glade/preferences.glade: Add language tab

View File

@ -53,9 +53,9 @@ Glib::ustring labelTrans(string const & label, string const & shortcut)
string labelN = label;
string::size_type i = label.find(shortcut);
if (i == string::npos)
return Glib::locale_to_utf8(label);
return Glib::convert(label, "UTF-8", "ISO-8859-1");
labelN.insert(i, "_");
return Glib::locale_to_utf8(labelN);
return Glib::convert(labelN, "UTF-8", "ISO-8859-1");
}
@ -120,7 +120,7 @@ void GMenubar::update()
void GMenubar::openByName(string const & name)
{
Glib::ustring uname = Glib::locale_to_utf8(name);
Glib::ustring uname = Glib::convert(name, "UTF-8", "ISO-8859-1");
std::vector<Glib::ustring>::iterator it =
std::find(mainMenuNames_.begin(), mainMenuNames_.end(),
uname);