A trap when using libgnomeui menu creation macros



This is a public service announcement. I meant to post it earlier in the
week, but it's still applicable now.

The libgnomeui library contains a number of handy macros for creating
menus and their contents (amongst other things). These are the ones of
the form GNOMEUIINFO_SUBTREE(...) and GNOMEUIINFO_SUBTREE_STOCK(...) and
corresponding GNOMEUIINFO_ITEM* macros.

Note that you should _not_ use GNOMEUIINFO_SUBTREE_STOCK if you are
creating a menu where you want to change the title. The code you get is
legal. It also looks fine in English-based locales. The string you
marked in the name even gets put into the *.po files for translators.
What does not happen is that the string gets translated at runtime.

Moral: If you want to create a menu with an application-specific name,
then you should use the GNOMEUIINFO_SUBTREE macros. Non-english speaking
locales will love you for it.

A number of problems of this sort were fixed just before the RC1 package
of gnome-utils was rolled, for example. It was only discovered that this
error was being made after the translators had been doing their job for
a while and a crazy Norwegian was running around clicking on everything
in sight to see what wasn't translated (yay, Kjarten). So if you have
been cut-and-pasting code lately in your non-core applications, just do
a quick double-check.

Malcolm

-- 



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