Re: gettext domain(s) and Bonobo



On Tue, Jan 04, 2000 at 07:07:05PM -0500, Elliot Lee wrote:
> On Tue, 4 Jan 2000, Sergey I. Panov wrote:
> 
> > I think that domain problem is even bigger --- e.g. if gill object
> > is plugged into abiword, then, when menu is replaced by gill menu
> > we will loose translations. E.g. when I insert image or mines component
> > in gnumeric it still searching gnumeric domain:
> 
> >  There should be some way to pass gettext domain and use
> > dgettext(COMPONENT_DOMAIN, str) for strings translation.
> 
> The way that I have been using so far (and the way that seems to work
> best) is just to have the text translated at the source of the text.
> Before passing text to gnumeric, the mines component should translate it.

 I looked at gnome-ui-handler.c in the gnome-libs HEAD branch. It did
not change by much. As before, labels and hints are translated at the
very last moment -- right before calling (or in the arg of)
gtk_accel_label_new, gtk_toolbar_append_element, and
gtk_object_set_data.

 Whouldn't it better to move GnomeUIHandlerMenuItem and
GnomeUIHandlerToolbarItem from bonobo in to libgnomeui along with
functions that handles those types ("Handler" and "_handler" should be
removed from those types and functions names):

    GnomeUIHandlerMenuItem*
    gnome_ui_handler_menu_parse_...(GnomeUIInfo *uii ...);

    void
    gnome_ui_handler_menu_free_...(GnomeUIHandlerMenuItem *item);

    GnomeUIHandlerToolbarItem*
    gnome_ui_handler_toolbar_parse_...(GnomeUIInfo *uii ...);

    void
    gnome_ui_handler_toolbar_free_...(GnomeUIHandlerToolbarItem *item);


and translate labels and hints only in:

    void
    menu_parse_uiinfo_one (GnomeUIHandlerMenuItem *item,
                           GnomeUIInfo *uii);
    void
    toolbar_parse_uiinfo_one (GnomeUIHandlerToolbarItem *item,
                              GnomeUIInfo *uii)

which are called from

  gnome_ui_handler_menu_parse_uiinfo_one,
  gnome_ui_handler_menu_parse_uiinfo_one_with_data,
  gnome_ui_handler_toolbar_parse_uiinfo_one,
  gnome_ui_handler_toolbar_parse_uiinfo_one_with_data.


Then, in libgnomeui, all functions like

  gnome_app_create_[menus/toolbar]...,
  gnome_app_fill_[menu/toolbar]_... , 
  gnome_app_insert_[menu/toolbar]_... ,
  gnome_app_remove_[menu/toolbar]_... ,
  gnome_app_install_..._hints

should be change to take GnomeUIHandlerMenuItem*,
GnomeUIHandlerToolbarItem* instead of GnomeUIInfo* uii [,gpointer data]. 

My guess is that change would also require moving seven hash tables from
GnomeUIHandlerTopLevelData to GnomeApp:

  path_to_menu_item,
  path_to_menu_widget,
  toolbars,
  path_to_toolbar_item,
  name_to_toolbar,
  name_to_toolbar_widget,
  path_to_toolbar_item_widge



Disclaimer:
Sorry, if it was discussed already, or if it unacceptably big change for
the next gnome-libs release. It is also possible that I miss problems
such change would cause or not aware of reasons why such change
does not make sense. 


        Sergey Panov



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