[Po4a-commits] "po4a/lib/Locale/Po4a Sgml.pm,1.122,1.123"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Sep 9 12:34:29 UTC 2007


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

Modified Files:
	Sgml.pm 
Log Message:
 * Document that nsgmls and the DTD of the document are required.
 * Try to detect better if nsgmls or the DTD is missing. Fail in these cases.


Index: Sgml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Sgml.pm,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- Sgml.pm	5 Aug 2007 15:33:13 -0000	1.122
+++ Sgml.pm	9 Sep 2007 12:34:27 -0000	1.123
@@ -42,6 +42,10 @@
 Locale::Po4a::Sgml is a module to help the translation of documentation in
 the SGML format into other [human] languages.
 
+This module uses B<nsgmls> to parse the SGML files. Make sure it is
+installed.
+Also make sure that the DTD of the SGML files are installed in the system.
+
 =head1 OPTIONS ACCEPTED BY THIS MODULE
 
 =over 4
@@ -363,6 +367,16 @@
         $origfile .= ${$self->{TT}{doc_in}}[$i];
         $i+=2;
     }
+    # Detect if we can find the DTD
+    open (VALID, "| nsgmls -p")
+        or die wrap_mod("po4a::sgml",
+                        dgettext("po4a", "Can't run nsgmls -p: %s"), $!);
+    print VALID $origfile;
+    close VALID
+        or die wrap_mod("po4a::sgml",
+                        dgettext("po4a", "Error while running nsgmls -p.  ".
+                                         "Please check if nsgmls and the ".
+                                         "DTD are installed."));
     # Detect the XML pre-prolog
     if ($origfile =~ s/^(\s*<\?xml[^?]*\?>)//) {
 	warn wrap_mod("po4a::sgml", dgettext("po4a",




More information about the Po4a-commits mailing list