Patching gettext to expose it's file parsing and writing functions. (http://www.golder.org/~rossg/tmp/gettext-0.14.1.exposed.patch) - Strangely, I seem to have achieved basic functionality by simply patching it to install a handful of it's header files into $includedir/gettext-0.0. It's a dirty hack, but it should prove the concept. - Potential problem: if while eusing gettext's parsing routines, it chances upon the 'error' function, exit() is called. Looks like gettext will need patching further to make the error handling in certain functions a bit more 'caller-friendly'. I expect it'll be a case of having everything report errors back to caller somehow, then hooking a error handler in further up the stack so that the caller does the 'exit'. Hopefully, this can be done without breaking API/ABI compat. It seems a bit odd that the gettext guys don't seem to have anticipated this use-case scenario.
Patching gtranslator to use gettext's innards for the reading/writing PO files. (http://www.golder.org/~rossg/tmp/gtranslator-gettext.patch - against gtranslator CVS) - Compiles OK using '#include <gettext-0.0/config.h>' (and a couple of other gettext innards) to hook into the newly exposed gettext API, and '-lgettextpo' lets it link successfully. I've now dropped various fields from GtrMsg, replacing it with a pointer to the 'message_ty' structure for each message. I've also re-wired everything to use this structure instead of the old GtrMsg fields, and it compiles. Still got some work to do on the parser (it currently segfaults), but it looks like I might finally get round to killing this 'plural forms' thing and a few other parser-related issues at the same time.