item_factory and NLS



OK, here's a GTK/NLS question that I don't think I'll be able to
answer for myself within a few minutes of posting.

I'm setting up a menu bar using gtk_item_factory: I create a large
array of GtkItemFactoryEntry[] and then populate the menu with
gtk_item_factory_create_items().  This worked just fine until I
started trying to internationalize my program.  I've wrapped the paths
in the GtkItemFactoryEntry[] items in "N_()" and attached a gettext
transformation via gtk_item_factory_set_translate_func().  The problem
is that the results seem "patchy": some of the menu items are coming
out right in translation but some are showing the original English
entries, even though the relevant .po and .mo files seem to be
complete.

I'm wondering whether this might be due to my not doing the "right
thing" with regard to (a) "branches" and (b) underscores.  That is,
suppose I have a top-level menu item "File" and off that hangs a "Save
as..." item, which in turn sprouts "foo" and "bar" sub-items.

The basic Entry code then looks like this:

{ N_("/File/Save _as/_foo..."), NULL, saveas, FOO, NULL },
{ N_("/File/Save _as/_bar..."), NULL, saveas, BAR, NULL },

Questions:

(1) Should I repeat the underscore in "Save _as" for entries other
than the first for this heading, or not?

(2) Should I preface "/File/Save _as/_foo..." with a "<Branch>" entry
for "/File/Save _as" by itself?

It doesn't seem to matter which way I go on either of these questions
so long as I'm monolingual, but I have the impression that
inconsistency in this respect may be responsible for the "patchiness"
in the way the translations are coming through -- but I haven't yet
spotted a definite pattern.  (Right now the translated strings match
the English ones in respect of presence/absence of underscores and
presence/absence of <Branch> items.)

Thanks for any help.

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC




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