[Po4a-devel] Re: Problems with Docbook/Xml module
Nicolas François
nicolas.francois at centraliens.net
Sat Oct 22 11:52:03 UTC 2005
On Fri, Oct 21, 2005 at 05:00:29PM +0200, thomas.huriaux at kti.ae.poznan.pl wrote:
> Hi again,
>
> Another problem found:
> <book lang="en">
> will be translated
> <book lang="fr
> "
>
> I think the solution is to modify Xml.pm as following:
> if ($options->{'type'} eq "tag") {
> [...]
> } elsif ($options->{'type'} eq "attribute") {
> $comment = "Attribute'".$options->{'attribute'}."' of: ".$self->get_path;
> $wrap = 0;
> } else {
>
> i.e. to force $wrap = 0 for the attributes;
I think this problem is more generic.
Attached is a patch for the Po.pm module.
(It restore exactly the same spaces at the end of the wrap method)
The problem is that it may have some consequences on many modules.
I will make some tests, and I would appreciate others' opinion.
> A related question: is there any way if the original does not contain
> the lang="en" attribute to add it in the translations? I don't think,
> but we never know.
I don't think it's possible at this time.
--
Nekral
-------------- next part --------------
Index: lib/Locale/Po4a/Po.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Po.pm,v
retrieving revision 1.45
diff -u -r1.45 Po.pm
--- lib/Locale/Po4a/Po.pm 3 Sep 2005 20:22:36 -0000 1.45
+++ lib/Locale/Po4a/Po.pm 22 Oct 2005 11:43:39 -0000
@@ -1154,6 +1154,10 @@
$first=0;
$res.="$line\n";
}
+ if ($text =~ m/(\s*)/s) {
+ chop $res;
+ $res .= $1;
+ }
return $res;
}
More information about the Po4a-devel
mailing list