gnome_app_find_menu_pos not reliable?



Hello!

I have noticed that GMC emits a warning when run with some locales.  The
debugger shows that gnome_app_find_menu_pos() cannot find the menu entry.
Here's the code (gnome/glayout.c:625 in mc CVS)

shell = gnome_app_find_menu_pos (app->menubar, _("File/New/Directory..."),
&pos);

This code assumes that "File/New/Directory..." is translated exactly to
the result of translation for "_File", "_New" and "_Directory..." with the
slashes added and the underscores removed.  This must be a wrong
assumption, especially because the translators are not told about that.

I searched google and found that the problem is not new.  For example, Dia
uses a special function that removes underscores.  However, it still
doesn't look like a good solution.

I would prefer to find the position by the number (i.e. 1->1->3) or by the
associated function (gnome_mkdir_cmd).  I don't see any interface for
that.  Does anybody know a better solution?

By the way, gnome_app_find_menu_pos() seems to be quite dangerous because
it breaks unexpectedly in some locales.  Are there plans to obsolete it?

-- 
Regards,
Pavel Roskin





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]