[Po4a-devel][PATCH] Stats of empty files

Yves Rutschle debian.anti-spam@rutschle.net
Sat, 4 Dec 2004 13:44:55 +0000


Hi all,

If a file has no msgids in it, po4a decides to set its "completed" stat to 0.
But if there are no msgids, then the file really is 100% translated:

diff -u -r1.30 Po.pm
--- lib/Locale/Po4a/Po.pm       27 Nov 2004 01:08:56 -0000      1.30
+++ lib/Locale/Po4a/Po.pm       4 Dec 2004 13:40:56 -0000
@@ -689,7 +689,7 @@
 sub stats_get() {
     my $self=shift;
     my ($h,$q)=($self->{gettexthits},$self->{gettextqueries});
-    my $p = ($q == 0 ? 0 : int($h/$q*10000)/100);
+    my $p = ($q == 0 ? 100 : int($h/$q*10000)/100);
 
 #    $p =~ s/\.00//;
 #    $p =~ s/(\..)0/$1/;


(Yes, I have a couple of files that need to go through the translation process
for consistency's sake, yet have no content to speak of)

Y.