Index: lib/Locale/Po4a/Xml.pm =================================================================== RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v retrieving revision 1.48 diff -u -r1.48 Xml.pm --- lib/Locale/Po4a/Xml.pm 13 Jun 2006 23:23:34 -0000 1.48 +++ lib/Locale/Po4a/Xml.pm 21 Nov 2006 00:28:33 -0000 @@ -59,6 +59,8 @@ #It will mantain the path from the root tag to the current one my @path; +my @comments; + sub read { my ($self,$filename)=@_; push @{$self->{DOCPOD}{infile}}, $filename; @@ -343,8 +345,7 @@ } else { die wrap_ref_mod($ref, "po4a::xml", dgettext("po4a", "Internal error: unknown type identifier '%s'."), $options->{'type'}); } - - $text = $self->translate($text,$ref,$comment,'wrap'=>$wrap); + $text = $self->translate($text,$ref,$comment,'wrap'=>$wrap, comment => $options->{'comments'}); return $text; } @@ -959,6 +960,7 @@ and $f_extract eq \&tag_extract_comment) { # Remove the content of the comments ($eof, @text) = $self->extract_tag($type,1); + push @comments, @text; } else { my ($tmpeof, @tag) = $self->extract_tag($type,0); # Append the found inline tag @@ -1201,6 +1203,15 @@ my ($self, $translate) = (shift, shift); my @paragraph = @_; + my $comments; + while (@comments) { + my ($t,$l) = (shift @comments, shift @comments); + $comments .= "\n" if defined $comments; + $comments .= $t; + } + $self->pushline("\n") if defined $comments; + @comments = (); + if ( length($self->join_lines(@paragraph)) > 0 ) { my $struc = $self->get_path; my $options = $self->tag_in_list($struc,@{$self->{tags}}); @@ -1211,7 +1222,8 @@ $self->join_lines(@paragraph), $paragraph[1], { type=>"tag", - tag_options=>$options + tag_options=>$options, + comments=>$comments })); } else { # Inform that this tag isn't translated in debug mode