2004-04-05  Danilo Šegan  <dsegan@gmx.net>

	* README: Document translators' comments additions.

	* intltool-extract.in.in (type_xml): Support translators' comments
	in XML files.
	(type_schemas): Support translators' comments in .schemas files.

--- intltool-extract.in.in.~1.56.~	Wed Jan  7 00:44:12 2004
+++ intltool-extract.in.in	Mon Apr  5 19:03:45 2004
@@ -270,14 +270,15 @@
         $messages{entity_decode_minimal($1)} = [];
     }
 
-    while ($input =~ /<_($w+)(?: xml:space="($w+)")?>(.+?)<\/_\1>/sg) {
-        $_ = $3;
-        if (!defined($2) || $2 ne "preserve") {
+    while ($input =~ /(?:<!--(.*?)-->[\t ]*\n[\t ]*)?<_($w+)(?: xml:space="($w+)")?>(.+?)<\/_\2>/sg) {
+        $_ = $4;
+        if (!defined($3) || $3 ne "preserve") {
             s/\s+/ /g;
             s/^ //;
             s/ $//;
         }
         $messages{entity_decode_minimal($_)} = [];
+        $comments{entity_decode_minimal($_)} = $1 if (defined($1));
     }
 }
 
@@ -287,16 +288,19 @@
     # FIXME: We should handle escaped < (less than)
     while ($input =~ /
                       <locale\ name="C">\s*
-                          (<default>\s*(.*?)\s*<\/default>\s*)?
-                          (<short>\s*(.*?)\s*<\/short>\s*)?
-                          (<long>\s*(.*?)\s*<\/long>\s*)?
+                          (<default>\s*(?:<!--(.*?)-->[\t ]*\n[\t ]*)?(.*?)\s*<\/default>\s*)?
+                          (<short>\s*(?:<!--(.*?)-->[\t ]*\n[\t ]*)?(.*?)\s*<\/short>\s*)?
+                          (<long>\s*(?:<!--(.*?)-->[\t ]*\n[\t ]*)?(.*?)\s*<\/long>\s*)?
                       <\/locale>
                      /sgx) {
-        my @totranslate = ($2,$4,$6);
+        my @totranslate = ($3,$6,$9);
+        my @eachcomment = ($2,$5,$8);
         foreach (@totranslate) {
+            my $currentcomment = shift @eachcomment;
             next if !$_;
-        s/\s+/ /g;
-        $messages{entity_decode_minimal($_)} = [];
+            s/\s+/ /g;
+            $messages{entity_decode_minimal($_)} = [];
+            $comments{entity_decode_minimal($_)} = $currentcomment if (defined($currentcomment));
         }
     }
 }
--- README.~1.23.~	Mon Feb 16 04:53:47 2004
+++ README	Mon Apr  5 19:47:01 2004
@@ -247,3 +247,15 @@
 
 Default keywords xgettext looks for if no XGETTEXT_KEYWORDS is defined
 are _, N_ and U_. 
+
+
+Translators' comments in XML and .schemas files
+...............................................
+
+To provide comments to translators in free-form XML or .schema files, 
+you need to precede the string to be translated with the plain XML 
+comment.  The comment *must* be followed by a new-line, or it will be 
+ignored.
+
+In .schemas files, comments need to be inside <default>, <short> or 
+<long> elements (i.e. they cannot be before the opening tag).
