I'm trying out gettext translations for xnec2c.
gettext generates a po/xnec2c.pot file at build time and I have translated that .pot file to de_DE and placed it in /usr/share/locale/de_DE/LC_MESSAGES/xnec2c.po (also tried as .pot and .mo).
If I invoke xnec2c as LC_ALL=de_DE ./xnec2c then I know it gets the locale because decimal points become comma's instead of periods in floating point values, but the text is not being translated. I've tried setting LC_MESSAGES=de_DE as well but no change in the text language.
The _() macro is defined as:
#define _(String) dgettext (PACKAGE, String)
and autoconf has PACKAGE defined as "xnec2c" in configure.ac which does show up properly in config.h.
The console output uses vfprintf as follows, note the use of _(format):
vfprintf(stderr, _(format), args);
and I have verified that the formatted strings to be printed exist in the translated .pot file.
How do I go about troubleshooting this issue? I've read quite a bit of gettext documentation and I'm not sure what to try next.
(The 'gtk' tag is on here because we are using a translated .glade file, too, in case that is relevant.)
Here are some samples (mechanically-translated as de is not my native $LANG):
xnec2c.pot
#: src/callback_func.c:684
msgid "View Currents"
msgstr ""
#: src/callback_func.c:810
msgid "GNUplot files (*.gplot)"
msgstr ""
#: src/callbacks.c:88 src/callbacks.c:328 src/callbacks.c:2065
msgid "Really quit xnec2c?"
msgstr ""
/usr/share/locale/de_DE/LC_MESSAGES/xnec2c.po
msgid "View Currents"
msgstr "Ströme anzeigen"
msgid "GNUplot files (*.gplot)"
msgstr "GNUplot-Dateien (*.gplot)"
msgid "Really quit xnec2c?"
msgstr "Wirklich verlassen xnec2c?"