OSDN Git Service

(split) LDP: Add untrans.html to show the translation status
[linuxjm/LDP_man-pages.git] / untrans-list.pl
index 278a4d7..cd89562 100755 (executable)
@@ -3,9 +3,18 @@
 sub print_header {
     print <<EOF;
 <HTML>
-<HEAD>Translation status of LDP man-pages</HEAD>
+<HEAD><TITLE>Translation status of LDP man-pages</TITLE>
+<STYLE type="text/css">
+<!--
+ tr.over80 { background-color: #AAFFAA; }
+ tr.over70 { background-color: #FFAAFF; }
+-->
+</STYLE>
+</HEAD>
 <BODY>
 <TABLE BORDER=1>
+<TR class=\"over80\"><TD COLSPAN=3>Released page but not completed (released if >=80%)</TD></TR>
+<TR class=\"over70\"><TD COLSPAN=3>Near release pageased (>= 70%)</TD></TR>
 <TR><TH>page name</TH><TH>remaining</TH><TH>comp. %</TH></TR>
 EOF
 }
@@ -23,6 +32,20 @@ sub print_poname {
           "<B>%s</B></TD></TR>\n", $poname);
 }
 
+sub print_manpage {
+    my ($page, $all, $remaining, $ratio) = @_;
+    if ($ratio >= 80) {
+        print '<TR class="over80">';
+    } elsif ($ratio >= 70) {
+        print '<TR class="over70">';
+    } else {
+       print '<TR>';
+    }
+    printf("<TD>%s</TD><TD>%d/%d</TD><TD>%.2f</TD>\n",
+          $page, $remaining, $all, $ratio);
+    print '</TR>';
+}
+
 $poname = "";
 $poname_print = 1;
 
@@ -49,9 +72,7 @@ while (<>) {
        print_poname($poname);
        $poname_print = 0;
     }
-    #printf("%s: %d/%d, %.2f\n", $page, $comp, $all, $comp/$all*100);
-    printf("<TR><TD>%s</TD><TD>%d/%d</TD><TD>%.2f</TD>\n",
-          $page, ($all - $comp), $all, $ratio);
+    print_manpage($page, $all, $all - $comp, $ratio);
 }
 
 print_footer();