Detlef Riekenberg wrote:
Am Montag, den 23.05.2005, 13:18 +0200 schrieb Francois Gouget:
Can we easily patch it to get rid of it? We don't need localized messages, maybe we can provide a dummy gettext.pm?
For the winetools shell-script, i use this function, ...
po4a is all perl so this does not work.
See my words below the Code "... but pearl is not my language." :-)
The Code was just a hint,
I understand. All I was saying is that po4a does not just call the 'gettext' command line utility. It links to the Locale::gettext perl module and then calls its gettext() and dgettext() functions. So it's not as simple as just wrapping the gettext tool in a script.
And, the gettext.pm perl module does not use the command line utility either. Instead it directly links with libgettext.so and won't load if it's missing.
So we basically have four solutions: 1) rip out all references to '.*gettext.*' from po4a. But this will result in a big diff which will make it hard to merge with later versions. 2) modify po4a to abstract all calls to gettext. This will also result in a big diff but might possibly be accepted upstream. 3) write a fake Locale::gettext perl module and force po4a to use it by hacking PO4AENV. Plus more hacks so users who have a real gettext.pm module can use it and get errors in their own language. 4) accept that Locale::gettext.pm is a requisite to running po4a and instruct users to install it.
But I have completed an analysis of the Wine documentation dependencies and I think that solutions 1-3 above are moot as they solve only a tiny bit of the problem. Here's the dependency list:
* docbook2html / db2html & co (command line tools) Needed to generate Html, Pdf, etc. Provided by docbook-utils on Debian, Fedora Core and SUSE.
* Locale::gettext (perl module) Needed by po4a for localization. Provided by liblocale-gettext-perl on Debian, perl-Locale-gettext on Mandrake, perl-gettext on SUSE.
* Text::WrapI18N (perl module) Needed by po4a, probably to wrap the text to put it into the po file and to generate the sgml file. Pure perl (so easy to check in) but depends on Text::CharWidth which is not pure perl. This one was not used in po4a 0.16.2 but I suspect this caused trouble with multibyte locales. Provided by libtext-wrapi18n-perl on Debian. Not found on SUSE.
* Term::ReadKey (perl module) Needed by po4a. Not sure why. Provided by libterm-readkey-perl on Debian, perl-Term-ReadKey on Mandrake, perl-TermReadKey on SUSE.
* SGMLS Needed by po4a to interface with the nsgmls parser. Pure perl (so easy to check in). Provided by libsgmls-perl on Debian, perl-SGMLS on SUSE.
* nsgmls (command line tool) Needed by po4a to parse the Sgml files. Provided by sp on Debian, opensp on SUSE.
So there's really no point to focus on Locale::gettext.pm. Also we cannot remove all these dependencies without breaking po4a completely. Finally we could check in all of those. But, except for the pure perl modules, these require a C compiler, which means headers and libraries to link with... We'd be adding more dependencies than we remove.
So I think the best is to check for those in the configure script and inform the user of missing dependencies. I attached a patch that does that for illustration purposes.