Translatable strings in .h file -- best way to resolve?
Jeff Kletsky
gnucash at allycomm.com
Mon Mar 15 20:27:26 EDT 2010
In src/libqof/qof/qofbookslots.h
<http://svn.gnucash.org/trac/browser/gnucash/trunk/src/libqof/qof/qofbookslots.h?rev=18464>
two #define statements were added
#define ACCOUNT_OPTIONS_SECTION "Accounts"
#define TRADING_ACCOUNTS_OPTION "Trading Accounts"
which need to be translatable (they are the option section and option
name for Guile-driven options screens, so the are not only keys to the
options KVP, but also rendered in the UI as the title on the tab and the
name of the option). These are a bit funky as they are needed both in
the C and the Guile world.
Presently, make-gnucash-potfiles.in does not look at .h files for
translatable strings, so even after adding
#include <glib/gi18n.h>
and marking the strings, they don't make it into POTFILES.in
What approach is recommended for resolving this?
* Add an exception to make-gnucash-potfiles.in
* Use _(ACCOUNTS_OPTIONS_SECTION) and don't translate the raw define
* Change .h to .c and leave people wondering why a .c file is being
#include-d
* Do something else I haven't thought of in a .c file
The first seems the cleanest, the second has the "advantage" of alerting
later coders that this really isn't a constant across all locales.
Suggestions from the maintainers on coding style for this would be
greatly appreciated.
-Jeff
More information about the gnucash-devel
mailing list