OSDN Git Service

(split) Update perkamon to catch up LDP 3.50
[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>Translation status of LDP man-pages</HEAD>
7 <BODY>
8 <TABLE BORDER=1>
9 <TR><TH>page name</TH><TH>remaining</TH><TH>comp. %</TH></TR>
10 EOF
11 }
12
13 sub print_footer {
14     print <<EOF;
15 </TABLE>
16 </BODY></HTML>
17 EOF
18 }
19
20 sub print_poname {
21     my $poname = shift;
22     printf("<TR><TD ALIGN=\"center\" COLSPAN=3 BGCOLOR=\"Yellow\">" .
23            "<B>%s</B></TD></TR>\n", $poname);
24 }
25
26 $poname = "";
27 $poname_print = 1;
28
29 print_header();
30
31 while (<>) {
32     if (/^po4a/) {
33         @dat = split;
34         $cfg = $dat[$#dat];
35         @dat = split('/', $cfg);
36         $poname = $dat[2];
37         $poname =~ s/\.cfg$//;
38         $poname_print = 1;
39     }
40     next if ! /^Discard /;
41     s/\(//;
42     s/\)//;
43     @dat = split(' ');
44     $page = $dat[1];
45     $comp = $dat[2];
46     $all  = $dat[4];
47     $ratio = $comp/$all*100;
48     if ($poname_print) {
49         print_poname($poname);
50         $poname_print = 0;
51     }
52     #printf("%s: %d/%d, %.2f\n", $page, $comp, $all, $comp/$all*100);
53     printf("<TR><TD>%s</TD><TD>%d/%d</TD><TD>%.2f</TD>\n",
54            $page, ($all - $comp), $all, $ratio);
55 }
56
57 print_footer();