[Po4a-commits] "po4a/lib/Locale/Po4a Xml.pm,1.62,1.63"

Nicolas FRANCOIS nekral-guest at alioth.debian.org
Sun Mar 2 00:24:24 UTC 2008


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

Modified Files:
	Xml.pm 
Log Message:
iAdded option defaulttranslateoption.
Need testing.


Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- Xml.pm	14 Feb 2008 21:29:12 -0000	1.62
+++ Xml.pm	2 Mar 2008 00:24:21 -0000	1.63
@@ -339,6 +339,7 @@
 	$self->{options}{'tags'}='';
 	$self->{options}{'translated'}='';
 	$self->{options}{'untranslated'}='';
+	$self->{options}{'defaulttranslateoption'}='';
 	$self->{options}{'attributes'}='';
 	$self->{options}{'inline'}='';
 	$self->{options}{'placeholder'}='';
@@ -1071,6 +1072,7 @@
 	my $path = shift;
 	my $options = "";
 	my $translate = 0;
+	my $usedefault = 1;
 
 	my $inlist = 0;
 	my $tag = $self->get_tag_from_list($path, @{$self->{tags}});
@@ -1078,6 +1080,7 @@
 		$inlist = 1;
 	}
 	if ($self->{options}{'tagsonly'} eq $inlist) {
+		$usedefault = 0;
 		if (defined $tag) {
 			$options = $tag;
 			$options =~ s/<.*$//;
@@ -1096,11 +1099,13 @@
 	# The translated and untranslated options have an higher priority.
 	$tag = $self->get_tag_from_list($path, @{$self->{untranslated}});
 	if (defined $tag) {
+		$usedefault = 0;
 		$options = "";
 		$translate = 0;
 	}
 	$tag = $self->get_tag_from_list($path, @{$self->{translated}});
 	if (defined $tag) {
+		$usedefault = 0;
 		$options = $tag;
 		$options =~ s/<.*$//;
 		$translate = 1;
@@ -1110,6 +1115,10 @@
 		$options .= ($self->{options}{'wrap'})?"w":"W";
 	}
 
+	if ($usedefault) {
+		$options = $self->{options}{'defaulttranslateoption'};
+	}
+
 	return $options;
 }
 




More information about the Po4a-commits mailing list