Re: GIMP menu items (was: Discussion topics for GU4DEC BoF)



Sven Neumann <sven@gimp.org> writes:

[...]

> > So it's a misfeature in the interface of GTK+?
> 
> from reading your mails, I got the impression that not all GTK+ apps
> do it the GIMP way but I am not aware of a clean and sane way that
> does not use full menu paths marked for translation.

I think most people use Glade. The GIMP is the only application I can
think of right now that actually needs dynamically created nested
menus.

> I wouldn't call this a misfeature of GTK+ since it is very convenient
> to be able to refer to a menu-item using it's path and it makes
> setting up menus relatively simple. There are probably other ways to
> integrate translation into this framework but at the moment I can't
> think of a better approach than the one we took. However we wrote this
> code some years ago and perhaps in the meantime someone has come up
> with a more elegant way to handle menu translation. I'd be happy to
> hear about it.

I had a look at GtkItemFactory, but I don't really understand how it
is supposed to work. Do you give a menu path like "/Edit/Stroke" and
then it creates the Stroke item?

If so, can't you simply split the parameter up into the path and the
name, like "/Edit/" and "Stroke" and only mark the latter?

If the factory also creates the Edit menu if it doesn't exist, I can
see that would be a problem. But then you could simply have two calls:

  create("/", _("Edit"));
  create("/Edit", ("Stroke"));

Or you could build up the path gradually, like create(_("Edit"),
_("Stroke")), or perhaps xxxprintf("/%s/%s", _("Edit"), _("Stroke")).

In fact, if this is the case, AFAICS you must already have the same
problem with the underscore accelerators in the English texts. Unless
they are repeated in all menu paths that contains e.g. "/Edit", one of
the strings has to be the 'master' that dictates how the Edit menu is
going to look like.

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/



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