[Po4a-commits] "po4a/lib/Locale/Po4a Xml.pm,1.70,1.71"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Mar 2 14:05:11 UTC 2008


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv21951/lib/Locale/Po4a

Modified Files:
	Xml.pm 
Log Message:
Do not translate strings which only consist in spaces.


Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- Xml.pm	2 Mar 2008 13:27:44 -0000	1.70
+++ Xml.pm	2 Mar 2008 14:05:08 -0000	1.71
@@ -444,6 +444,10 @@
 sub found_string {
 	my ($self,$text,$ref,$options)=@_;
 
+	if ($text =~ m/^\s*$/s) {
+		return $text;
+	}
+
 	my $comment;
 	my $wrap = $self->{options}{'wrap'};
 
@@ -1465,11 +1469,12 @@
 		}
 	}
 
-	if ( length($self->join_lines(@paragraph)) > 0 ) {
+	my $para = $self->join_lines(@paragraph);
+	if ( length($para) > 0 ) {
 		if ($translate ne "") {
 			# This tag should be translated
 			$self->pushline($self->found_string(
-				$self->join_lines(@paragraph),
+				$para,
 				$paragraph[1], {
 					type=>"tag",
 					tag_options=>$translate,
@@ -1477,9 +1482,9 @@
 				}));
 		} else {
 			# Inform that this tag isn't translated in debug mode
-			print wrap_ref_mod($paragraph[1], "po4a::xml", dgettext ("po4a", "Content of tag %s excluded: %s"), $self->get_path, $self->join_lines(@paragraph))
+			print wrap_ref_mod($paragraph[1], "po4a::xml", dgettext ("po4a", "Content of tag %s excluded: %s"), $self->get_path, $para)
 			       if $self->debug();
-			$self->pushline($self->recode_skipped_text($self->join_lines(@paragraph)));
+			$self->pushline($self->recode_skipped_text($para));
 		}
 	}
 }




More information about the Po4a-commits mailing list