Translate the WineFAQ to French

Francois Gouget fgouget at
Fri May 20 04:16:21 CDT 2005

Dimitrie Paun wrote:
> From: "Francois Gouget" <fgouget at>
>>[...] here's a patch to translate the
>>Wine FAQ to French using the new po4a/ directory.
> OK, I've applied the patch to make your life easier,
> but it needs a lot of work:
>   A. It doesn't work for me (details below)
>   B. The po-rules need to be moved to
>   C. We need to get rid of the .posgml and sed hack
> Let's fix these before we put in more translations.
> So, in reverse order:
>   C. We can do so by patching po4a-translate to
>      do the replacement itself, from within perl.
>      This should also get rid of the .posgml

I have started looking into this. The right fix is for po4a Sgml module 
to support translating attributes. I guess it has not been done yet 
because it's only useful for one attribute: lang. The problem is that 
this is not supported at all and I'm a bit lost as to how to modify it. 
It looks like it should be done near this code (line

                 if ($val->type() eq 'CDATA' ||
                     $val->type() eq 'IMPLIED') {
                     if (defined $value && length($value)) {
                         if ($value =~ m/"/) { #"
                             $value = "'".$value."'";
                         } else {
                             $value = '"'.$value.'"';
                         $tag .= ' '.lc($attr).'='.$value;

>   B. They need to be in the same format as the
>      other rules in (eg .sgml.txt)

They can't because the generated file depends on two source files and 
not just one. At least for this rule (but maybe you were thinking about 
another one):

%.posgml: $(SGMLDIR)/%.sgml %.po

Why is this not good?

>   A. I think we need to check in the generated
>      .sgml too to make it simple to use, so
>      others don't have to go through the pain.

This itself is going to be annoying.

>      Look:
> [dimi at dimi fr]$ make updatepo
> cd ../en && PERLLIB=../po4a/lib perl ../po4a/po4a-updatepo -f sgml -m
> wine-faq.s
> gml -p ../fr/wine-faq.po
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>         LANGUAGE = (unset),
>         LC_ALL = (unset),
>         LANG = "fr"
>     are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").

It looks like perl is being run in a French locale. Is this your doing 
or po4a's?

> Can't locate Locale/ in @INC (@INC contains: ../po4a/lib
> /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5

po4a depends on the gettext perl module. It's a standard Perl module so 
there should be an RPM for it. What's ironic is that this is just so 
po4a can issue localized error messages, AFAIK it's not needed for po4a 
to perform its work.
Once this is fixed you may find that you have to install the SGMLS perl 
module but po4a should give you a nice error message. That should be all 
of po4a's requirements I think.

Note that to compile the SGML sources you also have to install a bunch 
of packages (docbook, docbook-dsssl, jade, etc). po4a only adds two 
extra packages to the list which should not be too bad. We could also 
detect that the Perl packages are missing in the configure script and 
either issue an error message or disable the compilation of translated 
documentation. It's up to you.

Francois Gouget
fgouget at

More information about the wine-devel mailing list