[Po4a-commits] "po4a/lib/Locale/Po4a Xml.pm,1.93,1.94"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Feb 22 10:13:30 UTC 2009


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

Modified Files:
	Xml.pm 
Log Message:
	* lib/Locale/Po4a/Xml.pm: Check that the translated and
	untranslated lists are exclusive.
	* lib/Locale/Po4a/Xml.pm: Check that the break, inline and
	placeholder lists are exclusive.


Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- Xml.pm	22 Feb 2009 10:11:57 -0000	1.93
+++ Xml.pm	22 Feb 2009 10:13:28 -0000	1.94
@@ -1702,6 +1702,31 @@
 		$self->{placeholder}->{$2} = $1 || ""
 			unless $list_nodefault{$tag};
 	}
+
+	# There should be no translated and untranslated tags
+	foreach my $tag (keys %{$self->{translated}}) {
+		die wrap_mod("po4a::xml",
+		             dgettext("po4a",
+		                      "Tag '%s' both in the %s and %s categories."), $tag, "translated", "untranslated")
+			if $self->{untranslated}->{$tag};
+	}
+	# There should be no inline, break, and placeholder tags
+	foreach my $tag (keys %{$self->{inline}}) {
+		die wrap_mod("po4a::xml",
+		             dgettext("po4a",
+		                      "Tag '%s' both in the %s and %s categories."), $tag, "inline", "break")
+			if $self->{break}->{$tag};
+		die wrap_mod("po4a::xml",
+		             dgettext("po4a",
+		                      "Tag '%s' both in the %s and %s categories."), $tag, "inline", "placeholder")
+			if $self->{placeholder}->{$tag};
+	}
+	foreach my $tag (keys %{$self->{break}}) {
+		die wrap_mod("po4a::xml",
+		             dgettext("po4a",
+		                      "Tag '%s' both in the %s and %s categories."), $tag, "break", "placeholder")
+			if $self->{placeholder}->{$tag};
+	}
 }
 
 =head2 GETTING TEXT FROM THE INPUT DOCUMENT




More information about the Po4a-commits mailing list