[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.133,1.134"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Wed Mar 29 21:44:43 UTC 2006


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv22558/lib/Locale/Po4a

Modified Files:
	Man.pm 
Log Message:
Do not put the header at the top of the file, but just before the .TH
macro. This will preserve the indications on how to process the page if
the first line contains something like: '\" t

Even if this warning is not at the top of the file, I think it is still
visible for any translator who would like to translate the generated man
page.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- Man.pm	19 Mar 2006 22:54:56 -0000	1.133
+++ Man.pm	29 Mar 2006 21:44:41 -0000	1.134
@@ -1183,10 +1183,25 @@
     }
 } # end of main
 
-
+# We can't push the header in the first line of the document, as in the
+# other module, because the first line may contain indications on how the
+# man page must be processed.
 sub docheader {
-    return ".\\\" This file was generated with po4a. Translate the source file.\n".
-           ".\\\" \n";
+    return "";
+}
+
+# The header is pushed just before the .TH macro (this macro is mandatory
+# and must be specified at the begining (there may be macro definitions
+# before).
+sub push_docheader {
+    my $self = shift;
+    $self->pushline(
+".\\\"*******************************************************************\n".
+".\\\"\n".
+".\\\" This file was generated with po4a. Translate the source file.\n".
+".\\\"\n".
+".\\\"*******************************************************************\n"
+    );
 }
 
 # Split request's arguments.
@@ -1510,6 +1525,7 @@
     my ($th,$title,$section,$date,$source,$manual)=@_;
     #Preamble#.TH      title     section   date     source   manual
 #    print STDERR "TH=$th;titre=$title;sec=$section;date=$date;source=$source;manual=$manual\n";
+    $self->push_docheader();
     $self->pushmacro($th,
 		     $self->t($title),
 		     $section,




More information about the Po4a-commits mailing list