OSDN Git Service

(split) LDP: Update drafts from ja.po of LDP v3.51
[linuxjm/LDP_man-pages.git] / untrans-list.pl
1 #!/usr/bin/env perl
2
3 sub print_header {
4     print <<EOF;
5 <HTML>
6 <HEAD><TITLE>Translation status of LDP man-pages</TITLE>
7 <STYLE type="text/css">
8 <!--
9  tr.over80 { background-color: #AAFFAA; }
10  tr.over70 { background-color: #FFAAFF; }
11 -->
12 </STYLE>
13 </HEAD>
14 <BODY>
15 <TABLE BORDER=1>
16 <TR class=\"over80\"><TD COLSPAN=3>Released pages but not completed (released if &gt;=80%)</TD></TR>
17 <TR class=\"over70\"><TD COLSPAN=3>Near release pages (&gt;= 70%)</TD></TR>
18 <TR><TH>page name</TH><TH>remaining</TH><TH>comp. %</TH></TR>
19 EOF
20 }
21
22 sub print_footer {
23     print <<EOF;
24 </TABLE>
25 </BODY></HTML>
26 EOF
27 }
28
29 sub print_poname {
30     my $poname = shift;
31     printf("<TR><TD ALIGN=\"center\" COLSPAN=3 BGCOLOR=\"Yellow\">" .
32            "<B>%s</B></TD></TR>\n", $poname);
33 }
34
35 sub print_manpage {
36     my ($page, $all, $remaining, $ratio) = @_;
37     if ($ratio >= 80) {
38         print '<TR class="over80">';
39     } elsif ($ratio >= 70) {
40         print '<TR class="over70">';
41     } else {
42         print '<TR>';
43     }
44     printf("<TD>%s</TD><TD>%d/%d</TD><TD>%.2f</TD>",
45            $page, $remaining, $all, $ratio);
46     print "</TR>\n";
47 }
48
49 $poname = "";
50 $poname_print = 1;
51
52 print_header();
53
54 while (<>) {
55     if (/^po4a/) {
56         @dat = split;
57         $cfg = $dat[$#dat];
58         @dat = split('/', $cfg);
59         $poname = $dat[2];
60         $poname =~ s/\.cfg$//;
61         $poname_print = 1;
62     }
63     next if ! /^Discard /;
64     s/\(//;
65     s/\)//;
66     @dat = split(' ');
67     $page = $dat[1];
68     $comp = $dat[2];
69     $all  = $dat[4];
70     $ratio = $comp/$all*100;
71     if ($poname_print) {
72         print_poname($poname);
73         $poname_print = 0;
74     }
75     print_manpage($page, $all, $all - $comp, $ratio);
76 }
77
78 print_footer();