Re: gnome_app_find_menu_pos not reliable?
- From: James Henstridge <james daa com au>
- To: Pavel Roskin <proski gnu org>
- Cc: <gnome-devel-list gnome org>
- Subject: Re: gnome_app_find_menu_pos not reliable?
- Date: Wed, 25 Jul 2001 11:55:49 +0800 (WST)
On Tue, 24 Jul 2001, Pavel Roskin wrote:
>
> 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?
I have an alternative routine that is used in dia, found in
dia/app/menus.c. It works with untranslated strings in the GnomeUIInfo
structures. Feel free to use it as an alternative.
I agree with you that gnome_app_find_menu_pos is horribly broken w.r.t.
translations.
James.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]