Highlight messages with over 80% translated.
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 7 Apr 2009 20:56:36 +0000 (20:56 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 7 Apr 2009 20:56:36 +0000 (20:56 +0000)
wwwtools/nls-status-page
wwwtools/nls-status-table

index f7d4e8674fc73f7ab7e9ef913b8da0d81bed80e1..d8553564dfc8a3d0d56fc37d295c3ebcc2fc6ded 100755 (executable)
@@ -16,6 +16,7 @@ h1 { color: #EC5800; }
 h2 { border-bottom: solid 10px #0092C3; }
 a { color: #0092C3; }
 .newpo { color: #666; visibility: visible; }
+.qualifiedpo { background-color: #00FF00; }
 </style>
 <script type="text/javascript">
 function getStyleClass (className) {
index 3410973a577eb6f0b75630da87443e0e92f79edb..361ff843e6fd26efea0aa6714ced5dd60f884fed 100755 (executable)
@@ -11,6 +11,8 @@ use Getopt::Std;
 use POSIX qw(:math_h);
 use I18N::LangTags::List;
 
+our $QUALIFIED_CUTOFF = 80;
+
 my %opts;
 getopts('U:', \%opts) or die;
 my $po_url = $opts{'U'} || 'po';
@@ -65,6 +67,10 @@ foreach my $catalog (@catalogs) {
        if (not grep($_ eq $lang, @all_lang)) {
            push @all_lang, $lang;
        }
+
+        # Convert count to percentage here; can't do it above in case we
+        # hadn't seen the pot file yet.
+        $everything->{$catalog}{$lang} = floor($everything->{$catalog}{$lang}/$catalog_count{$catalog} * 100);
     }
 }
 
@@ -100,11 +106,12 @@ foreach my $catalog (sort @catalogs) {
     print "</th>\n";
 
     foreach my $lang (@all_lang) {
-       print "<td align=\"center\">";
-       my $trans = $everything->{$catalog}{$lang};
-       if (defined $trans and $trans>0) {
-           my $total = $catalog_count{$catalog};
-           my $pct = floor($trans/$total * 100);
+       my $pct = $everything->{$catalog}{$lang};
+       print "<td align=\"center\"";
+       print " class='qualifiedpo'" if (defined $pct and $pct >= $QUALIFIED_CUTOFF and !$errors->{"$catalog"}{"$lang"});
+       print ">";
+
+       if (defined $pct and $pct > 0) {
            if (!$new->{$catalog}{$lang}) {
                printf "<a href=\"$po_url/$catalog-$lang.po\">%.0f</a>", $pct;