Display the translation percentage of the pre-merge po file, not the post
authorPeter Eisentraut <peter_e@gmx.net>
Sat, 17 Jan 2009 21:22:39 +0000 (21:22 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Sat, 17 Jan 2009 21:22:39 +0000 (21:22 +0000)
merge.  Otherwise people might be led to think that the file is fully
translated, but really they need to commit the merge result first.

wwwtools/nls-status-table
wwwtools/pg-make-po
wwwtools/update-nls-www

index fdc5bfead8e4b300cb8e68f04272901836069bc0..3410973a577eb6f0b75630da87443e0e92f79edb 100755 (executable)
@@ -40,12 +40,17 @@ foreach (@ARGV) {
        next;
     };
 
-    /(\w+)-(\w+).po(\.new)?/ || next;
+    /(\w+)-(\w+).po/ || next;
     my $catalogname = $1;
     my $lang = $2;
-    $new->{$catalogname}{$lang} = 1 if $3;
 
-    my $tmp = `LC_ALL=C msgfmt -o /dev/null -v $_ 2>&1`;
+    my $tmp;
+    if (-e "$_.old") {
+       $tmp = `LC_ALL=C msgfmt -o /dev/null -v $_.old 2>&1`;
+    } else {
+       $tmp = `LC_ALL=C msgfmt -o /dev/null -v $_ 2>&1`;
+       $new->{$catalogname}{$lang} = 1;
+    }
     $tmp =~ /(\d+) translated/ and $everything->{"$catalogname"}{"$lang"} = $1;
     if (-f "$_.err") {
        $errors->{"$catalogname"}{"$lang"} = 1;
@@ -106,7 +111,7 @@ foreach my $catalog (sort @catalogs) {
                push @{$langavg{"$lang"}}, $pct;
                push @catavg, $pct;
            } else {
-               printf "<a class='newpo' href=\"$po_url/$catalog-$lang.po.new\">%.0f</a>", $pct;
+               printf "<a class='newpo' href=\"$po_url/$catalog-$lang.po\">%.0f</a>", $pct;
            }
 
            if ($errors->{"$catalog"}{"$lang"}) {
index 004e905aeca5699ce16e60d06394c474d38a6664..665417483a5b2ee1b01324f1f4c4f054b4f387cb 100755 (executable)
@@ -70,15 +70,17 @@ foreach (@ARGV) {
         if (! -f "$dirname/po/$lang.po.new") {
             # merge failed, proceed with old file
             system("cp $dirname/po/$lang.po $outdir/$catalogname-$lang.po") if (-f "$dirname/po/$lang.po");
+            system("cp $dirname/po/$lang.po $outdir/$catalogname-$lang.po.old") if (-f "$dirname/po/$lang.po");
         } elsif (-f "$dirname/po/$lang.po") {
             # existing po file merged
             system("cp $dirname/po/$lang.po.new $outdir/$catalogname-$lang.po");
+            system("cp $dirname/po/$lang.po $outdir/$catalogname-$lang.po.old");
             if (system("$msgfmt -o /dev/null -v -c $outdir/$catalogname-$lang.po >/dev/null 2>&1") != 0) {
                system("$msgfmt -o /dev/null -v -c $outdir/$catalogname-$lang.po 2>$outdir/$catalogname-$lang.po.err 1>/dev/null");
             }
         } else {
             # nonexisting po file merged
-            system("cp $dirname/po/$lang.po.new $outdir/$catalogname-$lang.po.new");
+            system("cp $dirname/po/$lang.po.new $outdir/$catalogname-$lang.po");
         }
     } # foreach $lang
 } # foreach @ARGV
index bc87cd607b6b041e64653b2c4760de3b56200652..769c5864c3f0d4fcb3832f1106a39468b4a80c6d 100755 (executable)
@@ -56,7 +56,7 @@ for branch in $active_branches; do
        files=`find $PGSRC -name nls.mk`
        $MYDIR/pg-make-po -o $WEBDIR/po-$branch -v $branch $files
 
-       (cd $WEBDIR/po-$branch && $MYDIR/nls-status-table -U po-$branch *.pot *.po *.po.new >$WEBDIR/table-$branch.html)
+       (cd $WEBDIR/po-$branch && $MYDIR/nls-status-table -U po-$branch *.pot *.po >$WEBDIR/table-$branch.html)
 
 #      $MYDIR/pg-make-conflicts $branch $MYDIR $WEBDIR