Translate the WineFAQ to French (gettext)
Francois Gouget
fgouget at codeweavers.com
Tue May 24 19:15:45 CDT 2005
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.
--
Francois Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /cvsroot/wine/docs/configure.ac,v
retrieving revision 1.2
diff -u -p -r1.2 configure.ac
--- configure.ac 18 May 2005 19:31:03 -0000 1.2
+++ configure.ac 24 May 2005 17:38:21 -0000
@@ -13,6 +13,13 @@ AC_CHECK_PROGS(DB2PDF, docbook2pdf db2pd
AC_CHECK_PROGS(DB2PS, docbook2ps db2ps, false)
AC_CHECK_PROGS(DB2TXT, docbook2txt db2txt, false)
+dnl Check for the Perl modules and tools needed by po4a
+perl -e 'use Locale::gettext; exit 0' 2>/dev/null && wd_perl_gettext="ok"
+perl -e 'use Text::WrapI18N; exit 0' 2>/dev/null && wd_perl_wrapi18n="ok"
+perl -e 'use Term::ReadKey; exit 0' 2>/dev/null && wd_perl_readkey="ok"
+perl -e 'use SGMLS; exit 0' 2>/dev/null && wd_perl_sgmls="ok"
+AC_CHECK_PROGS(NSGMLS, nsgmls, false)
+
dnl **** Generate output files ****
MAKE_RULES=Make.rules
@@ -27,6 +35,69 @@ fr/Makefile
AC_OUTPUT
+
+if test "$DB2HTML" = "false"
+then
+ echo
+ echo "*** Note: Your system appears to be missing docbook2html and db2html"
+ echo "*** which is needed to convert the documentation to HTML."
+ echo "*** To remedy this you will need one of the following packages"
+ echo "*** - Debian: docbook-utils"
+ echo "*** - Fedora Core: docbook-utils"
+ echo "*** - SUSE: docbook-utils"
+fi
+
+if test "x$wd_perl_gettext" = "x"
+then
+ echo
+ echo "*** Note: Your system appears to be missing the Locale::gettext perl module"
+ echo "*** which is needed to build the translated documentation using po4a."
+ echo "*** To remedy this you will need one of the following packages"
+ echo "*** - Debian: liblocale-gettext-perl"
+ echo "*** - Mandrake: perl-Locale-gettext"
+ echo "*** - SUSE: perl-gettext"
+fi
+
+if test "x$wd_perl_wrapi18n" = "x"
+then
+ echo
+ echo "*** Note: Your system appears to be missing the Text::WrapI18N perl module"
+ echo "*** which is needed to build the translated documentation using po4a."
+ echo "*** To remedy this you will need one of the following packages"
+ echo "*** - Debian: libtext-wrapi18n-perl"
+fi
+
+if test "x$wd_perl_readkey" = "x"
+then
+ echo
+ echo "*** Note: Your system appears to be missing the Term::ReadKey perl module"
+ echo "*** which is needed to build the translated documentation using po4a."
+ echo "*** To remedy this you will need one of the following packages"
+ echo "*** - Debian: libterm-readkey-perl"
+ echo "*** - Mandrake: perl-Term-ReadKey"
+ echo "*** - SUSE: perl-TermReadKey"
+fi
+
+if test "x$wd_perl_sgmls" = "x"
+then
+ echo
+ echo "*** Note: Your system appears to be missing the SGMLS perl module"
+ echo "*** which is needed to build the translated documentation using po4a."
+ echo "*** To remedy this you will need one of the following packages"
+ echo "*** - Debian: libsgmls-perl"
+ echo "*** - SUSE: perl-SGMLS"
+fi
+
+if test "$NSGMLS" = "false"
+then
+ echo
+ echo "*** Note: Your system appears to be missing the nsgmls parser"
+ echo "*** which is needed to build the translated documentation using po4a."
+ echo "*** To remedy this you will need one of the following packages"
+ echo "*** - Debian: sp"
+ echo "*** - SUSE: opensp"
+fi
+
echo
echo "Configure finished. Do '${ac_make}' to compile the documentation."
echo
More information about the wine-devel
mailing list