On Thu, May 19, 2005 at 11:59:52AM +0200, Francois Gouget wrote:
I am putting po4a in place for the translation of the Wine
documentation. Pretty much the only issue is that the text generated by
DocBook itself, 'Table of Contents' for instance, is not translated. The
reason is that the language to use for this text is defined by the
'lang' attribute as in:
<book lang="en">
...
</book>
But the value of the lang attribute is passed as is by po4a-translate. I
checked the Sgml.pm module and indeed it does not have any provision for
translating attributes :-(
It looks like it should be done near this code (line 680):
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;
Yes, that would be here. Something like:
if (lc($attr) eq "lang") {
$tag .= ' '.lc($attr).'='.$NEWLANG;
} else {
$tag .= ' '.lc($attr).'='.$value;
}
Not necessary really clean and robust, but working, I *guess*. But do you
know where we can get NEWLANG from? I don't remember of having this
information explecitely anywhere in po4a. we use to use this info as
rootname for the po files, but nothing enforces this until now. Maybe a new
module option?
}
Unfortunately that's as far as I got and now I don't have any idea on
how to modify this code to add this functionality. Maybe if someone can
provide me some pointers...
Bye, Mt.