[Po4a-commits] "po4a/lib/Locale/Po4a Man.pm,1.205,1.206"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Mon May 12 10:19:57 UTC 2008


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

Modified Files:
	Man.pm 
Log Message:
	* lib/Locale/Po4a/Man.pm: Avoid error messages without reference.
	When used with a configuration file, it is hard to know which
	file caused the failure.


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.205
retrieving revision 1.206
diff -u -d -r1.205 -r1.206
--- Man.pm	11 May 2008 10:47:22 -0000	1.205
+++ Man.pm	12 May 2008 10:19:54 -0000	1.206
@@ -651,32 +651,32 @@
         unless ($allow_generated) {
                 # Check for comments indicating that the file was generated.
                 if ($c =~ /Pod::Man/) {
-                    warn wrap_mod("po4a::man", dgettext("po4a", "This file was generated with Pod::Man. Translate the pod file with the pod module of po4a."));
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a", "This file was generated with Pod::Man. Translate the pod file with the pod module of po4a."));
                     exit 254;
                 } elsif ($c =~ /generated by help2man/)    {
-                    warn wrap_mod("po4a::man", dgettext("po4a", "This file was generated with help2man. Translate the source file with the regular gettext."));
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a", "This file was generated with help2man. Translate the source file with the regular gettext."));
                 } elsif ($c =~ /with docbook-to-man/)      {
-                    warn wrap_mod("po4a::man", dgettext("po4a", "This file was generated with docbook-to-man. Translate the source file with the sgml module of po4a."));
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a", "This file was generated with docbook-to-man. Translate the source file with the sgml module of po4a."));
                     exit 254;
                 } elsif ($c =~ /generated by docbook2man/) {
-                    warn wrap_mod("po4a::man", dgettext("po4a", "This file was generated with docbook2man. Translate the source file with the sgml module of po4a."));
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a", "This file was generated with docbook2man. Translate the source file with the sgml module of po4a."));
                     exit 254;
                 } elsif ($c =~ /created with latex2man/)   {
-                    warn wrap_mod("po4a::man", dgettext("po4a",
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a",
                         "This file was generated with %s. ".
                         "You should translate the source file, but continuing anyway."
                         ),"latex2man");
                 } elsif ($c =~ /Generated by db2man.xsl/)  { 
-                    warn wrap_mod("po4a::man", dgettext("po4a","This file was generated with db2man.xsl. Translate the source file with the xml module of po4a."));
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a","This file was generated with db2man.xsl. Translate the source file with the xml module of po4a."));
                     exit 254;
                 } elsif ($c =~ /generated automatically by mtex2man/)  {
-                    warn wrap_mod("po4a::man", dgettext("po4a",
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a",
                         "This file was generated with %s. ".
                         "You should translate the source file, but continuing anyway."
                         ),"mtex2man");
                 } elsif ($c =~ /THIS FILE HAS BEEN AUTOMATICALLY GENERATED.  DO NOT EDIT./ ||
                          $c =~ /DO NOT EDIT/i || $c =~ /generated/i) {
-                    warn wrap_mod("po4a::man", dgettext("po4a",
+                    warn wrap_ref_mod($ref, "po4a::man", dgettext("po4a",
                         "This file contains the line '%s'. ".
                         "You should translate the source file, but continuing anyway."
                         ),$l."\\\"".$c);
@@ -2044,8 +2044,8 @@
 $macro{'ad'}=\&untranslated;
 # .de macro Define or redefine macro until .. is encountered.
 $macro{'de'}=sub {
+    my $self = shift;
     if ($groff_code ne "fail") {
-        my $self = shift;
         my $paragraph = "@_";
         my $end = ".";
         if ($paragraph=~/^[.'][\t ]*de[\t ]+([^\t ]+)[\t ]+([^\t ]+)[\t ]$/) {
@@ -2071,7 +2071,7 @@
                                               "wrap" => 0) );
         }
     } else {
-        die wrap_mod("po4a::man", dgettext("po4a", "This page defines a new macro with '.de'. Since po4a is not a real groff parser, this is not supported."));
+        die wrap_ref_mod($self->{ref}, "po4a::man", dgettext("po4a", "This page defines a new macro with '.de'. Since po4a is not a real groff parser, this is not supported."));
     }
 };
 # .ds stringvar anything




More information about the Po4a-commits mailing list