Gonzalo Garramuño
unread,Mar 20, 2022, 5:28:47 PM3/20/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fltkc...@googlegroups.com
Currently, static menus are created with Fl_Menu_Item, like:
Fl_Menu_Item ViewerUI::menu_uiWindows[] = {
{_("Reels"), 0, (Fl_Callback*)ViewerUI::cb_Reels, 0, 0,
(uchar)FL_NORMAL_LABEL, 0, 14, 0},
{_("Media Info"), 0, (Fl_Callback*)ViewerUI::cb_Media, 0, 0,
(uchar)FL_NORMAL_LABEL, 0, 14, 0},
};
Then, gettext is run on the menus, like this:
{ Fl_Menu_Item* o = &menu_uiWindows[0];
o->label(gettext(o->label()));
}
The problem is that this modifies the original menu entry, as it is
modified thru a pointer. Ideally we would like a o->copy_label() call
but Fl_Menu_Item does not provide one. Another approach would be if the
menus would get add()ed like: uiWindows->add( menu_uiWindows[0][0] );
(and the other flags).
The issue I ran into is when the menus need to be recreated, like when
the UI changes language on the fly while the application is running.
The menus don't get recreated properly, as they contain the other
language, no longer the original language (English).
I can open a github issue for this, if you so desire (Matthias).