Hi, I'm using fltk-1.3.x and fluid with gettext i18n. If I add Fl_Choice widget
to some window in fluid, and then add predefined dropdown menu to that choice
widget, then fluid will generate menu as static class member object. Like this
one.
static Fl_Menu_Item ProgramEditor::menu_pause_item[] = {
{gettext("red"), 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 1},
{gettext("yellow"), 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 3},
{gettext("green"), 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 14, 61},
{0,0,0,0,0,0,0,0,0}
};
Then this array is used in constructor of window to construct choice widget
with it.
This array itself is created before main function executed, therefore before
proper locale is set. Thus gettext returns original messages, not translated
ones, and all menus in choices left untranslated.
Solution is to add it not like a static class member but local static object in
window constructor, just before it gets used. It still be created once, as a
static object, but not before main function. I tried to modify generated code
this way, it works.
Should I post this to your 'bugs&features'?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk