[Po4a-devel][CVS] po4a po4a,1.7,1.8

Martin Quinson po4a-devel@lists.alioth.debian.org
Sun, 18 Jul 2004 07:15:18 +0000


Update of /cvsroot/po4a/po4a
In directory haydn:/tmp/cvs-serv28913

Modified Files:
	po4a 
Log Message:
Fix last change; make error message look nice

Index: po4a
===================================================================
RCS file: /cvsroot/po4a/po4a/po4a,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- po4a	18 Jul 2004 06:42:40 -0000	1.7
+++ po4a	18 Jul 2004 07:15:16 -0000	1.8
@@ -261,14 +261,14 @@
 	$document{$main}{'format'} = $1;	
 	foreach my $arg (split(/ /,$args)) {
 	    die sprintf("%s:%d: ".
-		        gettext("The translated and master file are the same."),
-		        $config_file,$nb)
-	      if ($main eq $2);
-	    die sprintf("%s:%d: ".
 		        gettext("Unparsable argument '%s'").
 		        "\n",
 	                $config_file,$nb,$arg)
 	      unless ($arg =~ /^([^:]*):(.*)/);
+	    die sprintf("%s:%d: ".
+		        gettext("The translated and master file are the same."),
+		        $config_file,$nb)
+	      if ($main eq $2);
 	    $document{$main}{$1} = $2;
 	}
 
@@ -357,9 +357,15 @@
 		}
 	    }
 	}
-	print STDERR sprintf(gettext("%s is %s%% translated (%s of %s strings)."),
-	    $document{$master}{$lang},$percent,$hit,$queries)."\n" 
-	  if $verbose;
+	if ($verbose) {
+	    if ($percent == 100) {
+		print STDERR sprintf(gettext("%s is %s%% translated (%s strings)."),
+		    $document{$master}{$lang},$percent,$queries)."\n";
+	    } else {
+		print STDERR sprintf(gettext("%s is %s%% translated (%s of %s strings)."),
+		    $document{$master}{$lang},$percent,$hit,$queries)."\n";
+	    }
+	}
 
 	$doc->write($document{$master}{$lang});
     }