Re: menu-patch-2




Tim Janik <timj@gtk.org> writes:

> what i was thinking of is:
> 
> typedef void (GtkItemFactoryTranslateFunc) (GtkItemFactory      *ifactory,
>                                             GtkItemFactoryEntry *entry,
>                                             gchar              **item_name,
>                                             gchar	       **accelerator,
>                                             gpointer		 func_data);

> void gtk_item_factory_create_items_with_translation (GtkItemFactory *ifactory,
>                                          guint                   n_entries,
>                                          GtkItemFactoryEntry    *entries,
>                                          gpointer                callback_data,
>                                          GtkItemFactoryTranslateFunc func,
>                                          gpointer                 func_data);

We actually do need a hook like this - because strings in static
accelererators are only marked by gettext, not translated at
the spot. But probably it would just return a single 
internationalized translation of the menu path - not of the 
accelerator. This result would be used for the labels, but
not actually for the menu path.

Is it better to have it as a separate call? Or should it just
be a global option set on the ItemFactory, with the translation
function being used for every create_entries call?

(I'm still not sure what to do about the translation of normal
accelerators - my gut feeling is that they need to be translated, but
there isn't a slick way of translating them with the necessary
context, and non-English speakers keep telling me that translating
them isn't necessary. In any case, as long as keyboard navigation is
there, they are pretty irrelevant)

[...]

> we just put the "_" escapes into the menu items and thus make it easy
> for translators and programmers. the small downside of this is that
> people need to be aware of the accelerators when they refer to certain
> menu paths, that is the .menurc files will contain the underlines as well,
> and also all of the gimps
> 
> gimp_menu_item_set_sensitive ("/Images/Edit/Something", FALSE) need to be
> adjusted to something like
> gimp_menu_item_set_sensitive ("/_Images/_Edit/_Something", FALSE).
> (function name picked randomly).

My current code actually strips the '_' out when creating the
menu paths, and I think that is the correct thing to do. 
Similarly, the translation should be of the entry names, not
of the paths - so one doesn't have to worry that that should
be:

 gimp_menu_item_set_sensitive ("/Bilder/Blah/Etwas/");

Regards,
                                        Owen




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