[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.190,1.191"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Thu Nov 23 00:44:03 CET 2006


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

Modified Files:
	Man.pm 
Log Message:
Recode the skipped text.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -d -r1.190 -r1.191
--- Man.pm	7 Oct 2006 22:13:38 -0000	1.190
+++ Man.pm	22 Nov 2006 23:44:01 -0000	1.191
@@ -743,7 +743,7 @@
         # add comments
         foreach my $c (@comments) {
             # comments are pushed (maybe at the wrong place).
-            $self->SUPER::pushline(".\\\"$c\n");
+            $self->SUPER::pushline($self->r(".\\\"$c\n"));
         }
         @comments = ();
     }
@@ -1116,6 +1116,13 @@
     return $_[0]->translate($_[1]);
 }
 
+# shortcut.
+# As a rule of thumb, I do not recode macro names, unless they may be
+# followed by other characters.
+sub r {
+    return $_[0]->recode_skipped_text($_[1]);
+}
+
 
 sub do_paragraph {
     my ($self,$paragraph,$wrapped_mode) = (shift,shift,shift);
@@ -1213,7 +1220,7 @@
 	    #       => substitution like Perl's tr/ac/bd/ on output.
 	    if ($macro eq '\\"' || $macro eq '' || $macro eq 'tr' ||
 	        $macro eq '"'   || $macro eq '\\#') {
-		$self->pushline($line."\n");
+		$self->pushline($self->r($line)."\n");
 		goto LINE;
 	    }
 	    # Special case:
@@ -1225,7 +1232,7 @@
 		} else {
 		    $wrapped_mode='MACRONO';
 		}
-		$self->pushline($line."\n");
+		$self->pushline($self->r($line)."\n");
 		goto LINE;
 	    }
 	    
@@ -1241,7 +1248,7 @@
 	    if (defined ($macro{$macro})) {
 		&{$macro{$macro}}(@args);
 	    } else {
-		$self->pushline($line."\n");
+		$self->pushline($self->r($line)."\n");
 		die wrap_ref_mod($ref, "po4a::man", dgettext("po4a",
 		    "Unknown macro '%s'. Remove it from the document, or refer to the Locale::Po4a::Man manpage to see how po4a can handle new macros."), $line);
 	    }
@@ -1260,7 +1267,7 @@
 		# From info groff:
 		# Escape: \": Start a comment.  Everything to the end of the
 		# input line is ignored.
-		$self->pushline($line."\n");
+		$self->pushline($self->r($line)."\n");
 		goto LINE;
 	    } elsif ($line =~ /^\\#/) {
 		# Special groff comment. Do not keep the new line
@@ -1302,7 +1309,7 @@
     @next_comments = @comments;
     @comments = ();
     for my $c (@next_comments) {
-	$self->pushline(".\\\"$c\n");
+	$self->pushline($self->r(".\\\"$c\n"));
     }
 
     # reinitialize the module
@@ -1755,12 +1762,12 @@
     my ($line,$l2,$ref2);
     $line .= $_[0] if defined($_[0]);
     $line .= ' '.$_[1] if defined($_[1]);
-    $self->pushline($line."\n");
+    $self->pushline($self->r($line)."\n");
 
     ($l2,$ref2) = $self->shiftline();
     chomp($l2);
     while ($l2 =~ /^\.PD/) {
-	$self->pushline($l2."\n");
+	$self->pushline($self->r($l2)."\n");
 	($l2,$ref2) = $self->shiftline();
 	chomp($l2);
     }
@@ -1900,7 +1907,7 @@
         }
         $paragraph .= "\n";
         if ($groff_code eq "verbatim") {
-            $self->pushline($paragraph);
+            $self->pushline( $self->r($paragraph) );
         } else {
             $self->pushline( $self->translate($paragraph,
                                               $self->{ref},
@@ -1921,7 +1928,7 @@
     # find references to this string in the translation "\*(name" or
     # "\*[name]"
     $self->{type} = "ds $name";
-    $self->pushline($m." ".$name." ".$self->translate($string)."\n");
+    $self->pushline($m." ".$self->r($name)." ".$self->translate($string)."\n");
 };
 #       .fam      Return to previous font family.
 #       .fam name Set the current font family to name.
@@ -1991,7 +1998,7 @@
         }
         $paragraph .= "\n";
         if ($groff_code eq "verbatim") {
-            $self->pushline($paragraph);
+            $self->pushline( $self->r($paragraph) );
         } else {
             $self->pushline( $self->translate($paragraph,
                                               $self->{ref},
@@ -2014,7 +2021,7 @@
     $end='' if ($end =~ m/^\\\"/);
     my ($line,$ref)=$self->shiftline();
     while (defined($line)) {
-	$self->pushline($line);
+	$self->pushline($self->r($line));
 	last if ($line =~ /^\.$end\./);
 	($line,$ref)=$self->shiftline();
     }
@@ -2083,14 +2090,14 @@
     while (defined($line)) {
 	if ($line =~ /^\.TE/) {
 	    # Table end
-	    $self->pushline($line);
+	    $self->pushline($self->r($line));
 	    return;
 	}
 	if ($in_headers) {
 	    if ($line =~ /\.$/) {
 		$in_headers = 0;
 	    }
-	    $self->pushline($line);
+	    $self->pushline($self->r($line));
 	} elsif ($line =~ /\\$/) {
 	    # Lines are continued on \ at the end of line
 	    $buffer .= $line;
@@ -2279,7 +2286,7 @@
             }
         }
         if ($mdoc{$macroarg}) {
-            $self->pushline("$macroname ".$macroarg."\n");
+            $self->pushline("$macroname ".$self->r($macroarg)."\n");
         } else {
             $self->pushline("$macroname ".$self->t($macroarg)."\n");
         }




More information about the Po4a-commits mailing list