| 36 |
$opt_v = 0; |
$opt_v = 0; |
| 37 |
$opt_d = "u"; |
$opt_d = "u"; |
| 38 |
$opt_l = undef; |
$opt_l = undef; |
| 39 |
getopts('h:w:p:t:vd:l:') || die; |
$opt_b = ""; # Base URL, if not debian.org |
| 40 |
|
getopts('h:w:b:p:t:vd:l:') || die; |
| 41 |
# Replace filename globbing by Perl regexps |
# Replace filename globbing by Perl regexps |
| 42 |
$opt_p =~ s/\./\\./g; |
$opt_p =~ s/\./\\./g; |
| 43 |
$opt_p =~ s/\?/./g; |
$opt_p =~ s/\?/./g; |
| 78 |
$max_versions = 5; |
$max_versions = 5; |
| 79 |
$min_versions = 1; |
$min_versions = 1; |
| 80 |
|
|
| 81 |
$border_head = "<table width=\"95%\" align=\"center\" border=0 cellpadding=0 cellspacing=0><tr bgcolor=\"#000000\"><td>" |
# $border_head = "<table width=\"95%\" align=\"center\" border=0 cellpadding=0 cellspacing=0><tr bgcolor=\"#000000\"><td>" |
| 82 |
."<table width=\"100%\" border=0 cellpadding=0 cellspacing=1><tr bgcolor=\"#ffffff\"><td>"; |
# ."<table width=\"100%\" border=0 cellpadding=0 cellspacing=1><tr bgcolor=\"#ffffff\"><td>"; |
| 83 |
$border_foot = "</td></tr></table></td></tr></table>"; |
# $border_foot = "</td></tr></table></td></tr></table>"; |
| 84 |
|
|
| 85 |
|
|
| 86 |
$date = strftime "%a %b %e %H:%M:%S %Y %z", localtime; |
$date = strftime "%a %b %e %H:%M:%S %Y %z", localtime; |
| 93 |
|
|
| 94 |
sub format3($) { |
sub format3($) { |
| 95 |
$_ = sprintf("%d", shift); |
$_ = sprintf("%d", shift); |
| 96 |
$_ = " $_" if length($_) < 2; |
# $_ = " $_" if length($_) < 2; |
| 97 |
$_ = " $_" if length($_) < 3; |
# $_ = " $_" if length($_) < 3; |
| 98 |
$_; |
# $_; |
| 99 |
} |
} |
| 100 |
sub format5($) { |
sub format5($) { |
| 101 |
$_ = sprintf("%.1f", shift); |
$_ = sprintf("%d", shift); |
| 102 |
$_ = " $_" if length($_) < 4; |
# $_ = sprintf("%.1f", shift); |
| 103 |
$_ = " $_" if length($_) < 5; |
# $_ = " $_" if length($_) < 4; |
| 104 |
$_; |
# $_ = " $_" if length($_) < 5; |
| 105 |
|
# $_; |
| 106 |
} |
} |
| 107 |
# Count wml files in given directory |
# Count wml files in given directory |
| 108 |
# |
# |
| 309 |
$o_body .= sprintf "<td>%s</td>", $file; |
$o_body .= sprintf "<td>%s</td>", $file; |
| 310 |
} else { |
} else { |
| 311 |
(my $base = $file) =~ s/\.wml$//; |
(my $base = $file) =~ s/\.wml$//; |
| 312 |
$o_body .= sprintf "<td><a href=\"/%s.%s.html\">%s</a></td>", $base, $l, $base; |
$o_body .= sprintf "<td><a href=\"$opt_b/%s.%s.html\">%s</a></td>", $base, $l, $base; |
| 313 |
} |
} |
| 314 |
$o_body .= sprintf "<td>%s</td>", $transversion{"$lang/$file"}; |
$o_body .= sprintf "<td>%s</td>", $transversion{"$lang/$file"}; |
| 315 |
$o_body .= sprintf "<td>%s</td>", $version{"$orig/$file"}; |
$o_body .= sprintf "<td>%s</td>", $version{"$orig/$file"}; |
| 328 |
} else { |
} else { |
| 329 |
if (($file !~ /\.wml$/) |
if (($file !~ /\.wml$/) |
| 330 |
|| ($file eq "devel/wnpp/wnpp.wml")) { |
|| ($file eq "devel/wnpp/wnpp.wml")) { |
| 331 |
$t_body .= sprintf "%s<br>\n", $file; |
$t_body .= sprintf "<li>%s</li>\n", $file; |
| 332 |
} else { |
} else { |
| 333 |
(my $base = $file) =~ s/\.wml$//; |
(my $base = $file) =~ s/\.wml$//; |
| 334 |
$t_body .= sprintf "<a href=\"/%s.%s.html\">%s</a><br>\n", $base, $l, $base; |
$t_body .= sprintf "<li><a href=\"$opt_b/%s.%s.html\">%s</a></li>\n", $base, $l, $base; |
| 335 |
} |
} |
| 336 |
} |
} |
| 337 |
} |
} |
| 342 |
$u_body .= sprintf "<tr><td>%s</td><td> </td></tr>\n", $file; |
$u_body .= sprintf "<tr><td>%s</td><td> </td></tr>\n", $file; |
| 343 |
} else { |
} else { |
| 344 |
(my $base = $file) =~ s/\.wml$//; |
(my $base = $file) =~ s/\.wml$//; |
| 345 |
$u_body .= sprintf "<tr><td><a href=\"/%s\">%s</a></td><td align=\"right\">%d</td><td>(%.2f ‰)</td></tr>\n", $base, $base, $sizes{$file}, int($sizes{$file}/$nsize * 100000 + .5) / 100; |
$u_body .= sprintf "<tr><td><a href=\"$opt_b/%s\">%s</a></td><td align=\"right\">%d</td><td>(%.2f ‰)</td></tr>\n", $base, $base, $sizes{$file}, int($sizes{$file}/$nsize * 100000 + .5) / 100; |
| 346 |
} |
} |
| 347 |
$untranslated{$lang}++; |
$untranslated{$lang}++; |
| 348 |
$untranslated_s{$lang} += $sizes{$file}; |
$untranslated_s{$lang} += $sizes{$file}; |
| 378 |
$percent_us{$lang} = 100 - $percent_as{$lang}; |
$percent_us{$lang} = 100 - $percent_as{$lang}; |
| 379 |
|
|
| 380 |
if (open (HTML, ">$config{'htmldir'}/$l.html")) { |
if (open (HTML, ">$config{'htmldir'}/$l.html")) { |
| 381 |
printf HTML "<html><head><title>%s: %s</title></head><body bgcolor=\"#ffffff\">\n", $config{'title'}, ucfirst $lang; |
printf HTML "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"; |
| 382 |
|
# printf HTML "<html><head><title>%s: %s</title></head><body bgcolor=\"#ffffff\">\n", $config{'title'}, ucfirst $lang; |
| 383 |
|
printf HTML "<html>\n<head>\n"; |
| 384 |
|
printf HTML " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n"; |
| 385 |
|
printf HTML " <title>%s: %s</title>\n", $config{'title'}, ucfirst $lang; |
| 386 |
|
print HTML " <link href=\"../../../debian.css\" rel=\"stylesheet\" type=\"text/css\">"; |
| 387 |
|
print HTML "</head>\n<body>\n"; |
| 388 |
$color = get_color ($percent_a{$lang}); |
$color = get_color ($percent_a{$lang}); |
| 389 |
|
|
| 390 |
print HTML "<a name=\"top\"></a>\n"; |
printf HTML "<h1 style=\"background-color: %s\; margin: 0\;\"><a name=\"top\"></a>", $color; |
| 391 |
printf HTML "<table width=\"100%%\" cellpadding=2 cellspacing=0 bgcolor=\"%s\">\n", $color; |
printf HTML "%s: %s</h1>\n", $config{'title'}, ucfirst $lang; |
| 392 |
|
printf HTML "<table style=\"background-color: %s\; width: 100%\; font-weight: bold\; margin: 0\; text-align: center\;\">\n", $color; |
| 393 |
printf HTML "<tr><td colspan=4><h1 align=\"center\">%s: %s</h1></td></tr>", $config{'title'}, ucfirst $lang; |
print HTML "<colgroup span=\"4\" width=\"25%\"></colgroup>\n"; |
| 394 |
|
# printf HTML "<tr><td colspan=4><h1 align=\"center\">%s: %s</h1></td></tr>", $config{'title'}, ucfirst $lang; |
| 395 |
|
|
| 396 |
print HTML "<tr>\n"; |
print HTML "<tr><th>Translated</th><th>Up-to-date</th><th>Outdated</th><th>Not translated</th></tr>\n<tr>"; |
| 397 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) translated</b></td>", $wml{$lang}, $percent_a{$lang}; |
printf HTML "<td>%d files (%d%%)</td>", $wml{$lang}, $percent_a{$lang}; |
| 398 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) up to date</b></td>", $translated{$lang}, $percent_t{$lang}; |
printf HTML "<td>%d files (%d%%)</td>", $translated{$lang}, $percent_t{$lang}; |
| 399 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) outdated</b></td>", $outdated{$lang}, $percent_o{$lang}; |
printf HTML "<td>%d files (%d%%)</td>", $outdated{$lang}, $percent_o{$lang}; |
| 400 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d files (%d%%) not translated</b></td>", $untranslated{$lang}, $percent_u{$lang}; |
printf HTML "<td>%d files (%d%%)</td>", $untranslated{$lang}, $percent_u{$lang}; |
| 401 |
print HTML "</tr>\n"; |
print HTML "</tr>\n"; |
| 402 |
print HTML "<tr>\n"; |
print HTML "<tr>\n"; |
| 403 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) translated</b></td>", $wml_s{$lang}, $percent_as{$lang}; |
printf HTML "<td>%d bytes (%.1f%%)</td>", $wml_s{$lang}, $percent_as{$lang}; |
| 404 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) up to date</b></td>", $translated_s{$lang}, $percent_ts{$lang}; |
printf HTML "<td>%d bytes (%.1f%%)</td>", $translated_s{$lang}, $percent_ts{$lang}; |
| 405 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) outdated</b></td>", $outdated_s{$lang}, $percent_os{$lang}; |
printf HTML "<td>%d bytes (%.1f%%)</td>", $outdated_s{$lang}, $percent_os{$lang}; |
| 406 |
printf HTML "<td align=\"center\" width=\"25%%\"><b>%d bytes (%.1f%%) not translated</b></td>", $nsize-$wml_s{$lang}, $percent_us{$lang}; |
printf HTML "<td>%d bytes (%.1f%%)</td>", $nsize-$wml_s{$lang}, $percent_us{$lang}; |
| 407 |
print HTML "</tr>\n"; |
print HTML "</tr>\n"; |
| 408 |
print HTML "</table>\n"; |
print HTML "</table>\n"; |
| 409 |
|
|
| 410 |
# Make the table of content |
# Make the table of content |
| 411 |
print HTML "<h3>Table of Contents</h3>\n"; |
print HTML "<h3>Table of Contents</h3>\n"; |
| 412 |
print HTML "<p><a href=\"./\">Back to index of languages</a>\n"; |
print HTML "<ul>\n"; |
| 413 |
print HTML "<br /><a href=\"../\">Working on the website</a>\n"; |
print HTML "<li><a href=\"./\">Back to index of languages</a>\n"; |
| 414 |
|
print HTML "<li><a href=\"../\">Working on the website</a>\n"; |
| 415 |
if ($o_body) { |
if ($o_body) { |
| 416 |
print HTML "<br /><a href=\"#outdated\">Outdated translations</a>\n"; |
print HTML "<li><a href=\"#outdated\">Outdated translations</a>\n"; |
| 417 |
} |
} |
| 418 |
if ($u_body) { |
if ($u_body) { |
| 419 |
print HTML "<br /><a href=\"#untranslated\">Pages not translated</a>\n"; |
print HTML "<li><a href=\"#untranslated\">Pages not translated</a>\n"; |
| 420 |
} |
} |
| 421 |
if ($t_body) { |
if ($t_body) { |
| 422 |
print HTML "<br /><a href=\"#uptodate\">Translations up to date</a>\n"; |
print HTML "<li><a href=\"#uptodate\">Translations up to date</a>\n"; |
| 423 |
} |
} |
| 424 |
if ($lang ne 'english') { |
if ($lang ne 'english') { |
| 425 |
print HTML "<br /><a href=\"#gettext\">Translations of templates (gettext files)</a>\n"; |
print HTML "<li><a href=\"#gettext\">Translations of templates (gettext files)</a>\n"; |
| 426 |
} |
} |
| 427 |
print HTML "</p>\n"; |
print HTML "</ul>\n"; |
| 428 |
|
|
| 429 |
# outputs the content |
# outputs the content |
| 430 |
if ($o_body) { |
if ($o_body) { |
| 448 |
} |
} |
| 449 |
if ($t_body) { |
if ($t_body) { |
| 450 |
print HTML "<h3><a name='uptodate'>Translations up to date</a>: <a href='#top'>(top)</a></h3>\n"; |
print HTML "<h3><a name='uptodate'>Translations up to date</a>: <a href='#top'>(top)</a></h3>\n"; |
| 451 |
|
print HTML "<ul class=\"discless\">\n"; |
| 452 |
print HTML $t_body; |
print HTML $t_body; |
| 453 |
|
print HTML "</ul>\n"; |
| 454 |
} |
} |
| 455 |
# outputs the gettext stats |
# outputs the gettext stats |
| 456 |
if ($lang ne 'english') { |
if ($lang ne 'english') { |
| 457 |
print HTML "<h3><a name='gettext'>Translations of templates (gettext files)</a>: <a href='#top'>(top)</a></h3>\n"; |
print HTML "<h3><a name='gettext'>Translations of templates (gettext files)</a>: <a href='#top'>(top)</a></h3>\n"; |
| 458 |
# print HTML $border_head; |
# print HTML $border_head; |
| 459 |
print HTML "<table width=\"100%\" border=0>\n"; |
print HTML "<table width=\"100%\">\n"; |
| 460 |
print HTML "<tr><th>File</th><th>Up to date</th><th>Fuzzy</th><th>Untranslated</th><th>Total</th></tr>\n"; |
print HTML "<tr><th>File</th><th>Up to date</th><th>Fuzzy</th><th>Untranslated</th><th>Total</th></tr>\n"; |
| 461 |
foreach my $domain (sort keys %po_total) { |
foreach my $domain (sort keys %po_total) { |
| 462 |
next if $domain eq 'total'; |
next if $domain eq 'total'; |
| 467 |
$color_u = get_color (100 - $percent_po_u{$domain}{$lang}); |
$color_u = get_color (100 - $percent_po_u{$domain}{$lang}); |
| 468 |
|
|
| 469 |
print HTML "<td>$domain.$langs{$lang}.po</td>"; |
print HTML "<td>$domain.$langs{$lang}.po</td>"; |
| 470 |
printf HTML "<td bgcolor=\"%s\" align=right>%d (%s%%)</td>", $color_t, $po_translated{$domain}{$lang}, $percent_po_t{$domain}{$lang}; |
printf HTML "<td style=\"background-color: %s\" align=right>%d (%s%%)</td>", $color_t, $po_translated{$domain}{$lang}, $percent_po_t{$domain}{$lang}; |
| 471 |
printf HTML "<td bgcolor=\"%s\" align=right>%d (%s%%)</td>", $color_f, $po_fuzzy{$domain}{$lang}, $percent_po_f{$domain}{$lang}; |
printf HTML "<td style=\"background-color: %s\" align=right>%d (%s%%)</td>", $color_f, $po_fuzzy{$domain}{$lang}, $percent_po_f{$domain}{$lang}; |
| 472 |
printf HTML "<td bgcolor=\"%s\" align=right>%d (%s%%)</td>", $color_u, $po_untranslated{$domain}{$lang}, $percent_po_u{$domain}{$lang}; |
printf HTML "<td style=\"background-color: %s\" align=right>%d (%s%%)</td>", $color_u, $po_untranslated{$domain}{$lang}, $percent_po_u{$domain}{$lang}; |
| 473 |
printf HTML "<td align=right>%d</td>", $po_total{$domain}; |
printf HTML "<td align=right>%d</td>", $po_total{$domain}; |
| 474 |
print HTML "</tr>\n"; |
print HTML "</tr>\n"; |
| 475 |
} |
} |
| 477 |
$color_t = get_color ($percent_po_t{'total'}{$lang}); |
$color_t = get_color ($percent_po_t{'total'}{$lang}); |
| 478 |
$color_f = get_color (100 - $percent_po_f{'total'}{$lang}); |
$color_f = get_color (100 - $percent_po_f{'total'}{$lang}); |
| 479 |
$color_u = get_color (100 - $percent_po_u{'total'}{$lang}); |
$color_u = get_color (100 - $percent_po_u{'total'}{$lang}); |
| 480 |
printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_t, $po_translated{'total'}{$lang}, $percent_po_t{'total'}{$lang}; |
printf HTML "<td style=\"background-color: %s\" align=right>%d (%d%%)</td>", $color_t, $po_translated{'total'}{$lang}, $percent_po_t{'total'}{$lang}; |
| 481 |
printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, $percent_po_f{'total'}{$lang}; |
printf HTML "<td style=\"background-color: %s\" align=right>%d (%d%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, $percent_po_f{'total'}{$lang}; |
| 482 |
printf HTML "<td bgcolor=\"%s\" align=right>%d (%d%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, $percent_po_u{'total'}{$lang}; |
printf HTML "<td style=\"background-color: %s\" align=right>%d (%d%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, $percent_po_u{'total'}{$lang}; |
| 483 |
printf HTML "<td align=right>%d</td>", $po_total{'total'}; |
printf HTML "<td align=right>%d</td>", $po_total{'total'}; |
| 484 |
print HTML "</tr>\n"; |
print HTML "</tr>\n"; |
| 485 |
|
print HTML "</table>\n"; |
| 486 |
} |
} |
|
print HTML "</table>\n"; |
|
| 487 |
|
|
| 488 |
# outputs footer |
# outputs footer |
| 489 |
print HTML "<hr><address>Compiled at $date</address>\n"; |
print HTML "<hr><address>Compiled at $date</address>\n"; |
| 497 |
# =============== Creating index.html =============== |
# =============== Creating index.html =============== |
| 498 |
print "Creating index.html... " if ($config{'verbose'}); |
print "Creating index.html... " if ($config{'verbose'}); |
| 499 |
|
|
| 500 |
open (HTML, ">$config{'htmldir'}/index.html") |
open (HTMLI, ">$config{'htmldir'}/index.html") |
| 501 |
|| die "Can't open $config{'htmldir'}/index.html"; |
|| die "Can't open $config{'htmldir'}/index.html"; |
| 502 |
|
|
| 503 |
printf HTML "<html>\n<head><title>%s</title></head>\n<body bgcolor=\"#ffffff\">\n", $config{'title'}; |
# printf HTMLI "<html>\n<head><title>%s</title></head>\n<body bgcolor=\"#ffffff\">\n", $config{'title'}; |
| 504 |
printf HTML "<h1 align=\"center\">%s</h1>\n", $config{'title'}; |
# printf HTMLI "<h1 align=\"center\">%s</h1>\n", $config{'title'}; |
| 505 |
|
printf HTMLI "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n"; |
| 506 |
print HTML "<h2>Translated web pages</h2>\n"; |
printf HTMLI " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n"; |
| 507 |
printf HTML "<p>There are %d pages to translate.</p>\n",($wml{'english'}+$untranslated{'english'}); |
printf HTMLI " <title>%s</title>\n", $config{'title'}; |
| 508 |
|
print HTMLI " <link href=\"../../../debian.css\" rel=\"stylesheet\" type=\"text/css\">"; |
| 509 |
print HTML $border_head; |
printf HTMLI "</head>\n<body>\n"; |
| 510 |
print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n"; |
printf HTMLI "<h1>%s</h1>\n", $config{'title'}; |
| 511 |
print HTML "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n"; |
print HTMLI "<h2>Translated web pages</h2>\n"; |
| 512 |
|
printf HTMLI "<p>There are %d pages to translate.</p>\n",($wml{'english'}+$untranslated{'english'}); |
| 513 |
|
|
| 514 |
|
# print HTMLI $border_head; |
| 515 |
|
print HTMLI "<table class=\"stattrans\">\n"; |
| 516 |
|
print HTMLI "<colgroup width=\"20%\">\n"; |
| 517 |
|
print HTMLI "<col>\n"; |
| 518 |
|
print HTMLI "</colgroup>"; |
| 519 |
|
print HTMLI "<colgroup width=\"10%\">\n"; |
| 520 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 521 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 522 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 523 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 524 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 525 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 526 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 527 |
|
print HTMLI "<col width=\"10%\">\n"; |
| 528 |
|
print HTMLI "</colgroup>"; |
| 529 |
|
print HTMLI "<thead>"; |
| 530 |
|
print HTMLI "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n"; |
| 531 |
|
print HTMLI "</thead>"; |
| 532 |
|
print HTMLI "<tbody>"; |
| 533 |
foreach $lang (@search_in) { |
foreach $lang (@search_in) { |
| 534 |
my @processed_langs = ($langs{$lang}); |
my @processed_langs = ($langs{$lang}); |
| 535 |
@processed_langs = ("zh-cn", "zh-tw") if $langs{$lang} eq "zh"; |
@processed_langs = ("zh-cn", "zh-tw") if $langs{$lang} eq "zh"; |
| 539 |
$color_o = get_color (100 - $percent_o{$lang}); |
$color_o = get_color (100 - $percent_o{$lang}); |
| 540 |
$color_u = get_color (100 - $percent_u{$lang}); |
$color_u = get_color (100 - $percent_u{$lang}); |
| 541 |
|
|
| 542 |
print HTML "<tr>"; |
print HTMLI "<tr>"; |
| 543 |
printf HTML "<td><a href=\"%s.html\">%s</a> (%s)</td>", $l, ucfirst $lang, $l; |
printf HTMLI "<th><a href=\"%s.html\">%s</a> (%s)</th>", $l, ucfirst $lang, $l; |
| 544 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_a, $wml{$lang}, format3($percent_a{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_a, $wml{$lang}, format3($percent_a{$lang}); |
| 545 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $translated{$lang}, format3($percent_t{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_t, $translated{$lang}, format3($percent_t{$lang}); |
| 546 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_o, $outdated{$lang}, format3($percent_o{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_o, $outdated{$lang}, format3($percent_o{$lang}); |
| 547 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $untranslated{$lang}, format3($percent_u{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_u, $untranslated{$lang}, format3($percent_u{$lang}); |
| 548 |
print HTML "</tr>\n"; |
print HTMLI "</tr>\n"; |
| 549 |
} |
} |
| 550 |
} |
} |
| 551 |
print HTML "</table>\n"; |
print HTMLI "</tbody>"; |
| 552 |
print HTML $border_foot; |
print HTMLI "</table>\n"; |
| 553 |
|
# print HTMLI $border_foot; |
| 554 |
print HTML "<h2>Translated web pages (by size)</h2>\n"; |
|
| 555 |
printf HTML "<p>There are %d bytes to translate.</p>\n",($wml_s{'english'}+$untranslated_s{'english'}); |
print HTMLI "<h2>Translated web pages (by size)</h2>\n"; |
| 556 |
|
printf HTMLI "<p>There are %d bytes to translate.</p>\n",($wml_s{'english'}+$untranslated_s{'english'}); |
| 557 |
print HTML $border_head; |
|
| 558 |
print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n"; |
# print HTMLI $border_head; |
| 559 |
print HTML "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n"; |
print HTMLI "<table class=\"stattrans\">\n"; |
| 560 |
|
# print HTMLI "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n"; |
| 561 |
|
print HTMLI "<colgroup span=\"1\">\n"; |
| 562 |
|
print HTMLI "<col width=\"20%\">\n"; |
| 563 |
|
print HTMLI "</colgroup>"; |
| 564 |
|
print HTMLI "<colgroup span=\"8\">\n"; |
| 565 |
|
print HTMLI "<col width=\"13%\">\n"; |
| 566 |
|
print HTMLI "<col width=\"7%\">\n"; |
| 567 |
|
print HTMLI "<col width=\"13%\">\n"; |
| 568 |
|
print HTMLI "<col width=\"7%\">\n"; |
| 569 |
|
print HTMLI "<col width=\"13%\">\n"; |
| 570 |
|
print HTMLI "<col width=\"7%\">\n"; |
| 571 |
|
print HTMLI "<col width=\"13%\">\n"; |
| 572 |
|
print HTMLI "<col width=\"7%\">\n"; |
| 573 |
|
print HTMLI "</colgroup>"; |
| 574 |
|
print HTMLI "<thead>"; |
| 575 |
|
print HTMLI "<tr><th>Language</th><th colspan=\"2\">Translations</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Outdated</th><th colspan=\"2\">Not translated</th></tr>\n"; |
| 576 |
|
print HTMLI "</thead>"; |
| 577 |
|
print HTMLI "<tbody>"; |
| 578 |
|
|
| 579 |
foreach $lang (@search_in) { |
foreach $lang (@search_in) { |
| 580 |
my @processed_langs = ($langs{$lang}); |
my @processed_langs = ($langs{$lang}); |
| 585 |
$color_o = get_color (100 - $percent_o{$lang}); |
$color_o = get_color (100 - $percent_o{$lang}); |
| 586 |
$color_u = get_color (100 - $percent_u{$lang}); |
$color_u = get_color (100 - $percent_u{$lang}); |
| 587 |
|
|
| 588 |
print HTML "<tr>"; |
print HTMLI "<tr>"; |
| 589 |
printf HTML "<td><a href=\"%s.html\">%s</a> (%s)</td>", $l, ucfirst $lang, $l; |
printf HTMLI "<th><a href=\"%s.html\">%s</a> (%s)</th>", $l, ucfirst $lang, $l; |
| 590 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_a, $wml_s{$lang}, format5($percent_as{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_a, $wml_s{$lang}, format5($percent_as{$lang}); |
| 591 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $translated_s{$lang}, format5($percent_ts{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_t, $translated_s{$lang}, format5($percent_ts{$lang}); |
| 592 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_o, $outdated_s{$lang}, format5($percent_os{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_o, $outdated_s{$lang}, format5($percent_os{$lang}); |
| 593 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $wml_s{"english"}+$untranslated_s{'english'}-$wml_s{$lang}, format5($percent_us{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_u, $wml_s{"english"}+$untranslated_s{'english'}-$wml_s{$lang}, format5($percent_us{$lang}); |
| 594 |
print HTML "</tr>\n"; |
print HTMLI "</tr>\n"; |
| 595 |
} |
} |
| 596 |
} |
} |
| 597 |
print HTML "</table>\n"; |
print HTMLI "</tbody>"; |
| 598 |
print HTML $border_foot; |
print HTMLI "</table>\n"; |
| 599 |
|
# print HTMLI $border_foot; |
| 600 |
print HTML "<h2>Translated templates (gettext files)</h2>\n"; |
|
| 601 |
printf HTML "<p>There are %d strings to translate.</p>\n",$po_total{'total'}; |
print HTMLI "<h2>Translated templates (gettext files)</h2>\n"; |
| 602 |
print HTML $border_head; |
printf HTMLI "<p>There are %d strings to translate.</p>\n",$po_total{'total'}; |
| 603 |
print HTML "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n"; |
# print HTMLI $border_head; |
| 604 |
print HTML "<tr><th>Language</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Fuzzy</th><th colspan=\"2\">Not translated</th></tr>\n"; |
print HTMLI "<table class=\"stattrans\">\n"; |
| 605 |
|
# print HTMLI "<table width=\"100%\" border=0 bgcolor=\"#cdc9c9\">\n"; |
| 606 |
|
print HTMLI "<colgroup span=\"1\"width=\"28%\">\n"; |
| 607 |
|
print HTMLI "</colgroup>"; |
| 608 |
|
print HTMLI "<colgroup span=\"6\" width=\"12%\">\n"; |
| 609 |
|
print HTMLI "<col width=\"12%\">\n"; |
| 610 |
|
print HTMLI "<col width=\"12%\">\n"; |
| 611 |
|
print HTMLI "<col width=\"12%\">\n"; |
| 612 |
|
print HTMLI "<col width=\"12%\">\n"; |
| 613 |
|
print HTMLI "<col width=\"12%\">\n"; |
| 614 |
|
print HTMLI "<col width=\"12%\">\n"; |
| 615 |
|
print HTMLI "</colgroup>"; |
| 616 |
|
print HTMLI "<thead>"; |
| 617 |
|
print HTMLI "<tr><th>Language</th><th colspan=\"2\">Up to date</th><th colspan=\"2\">Fuzzy</th><th colspan=\"2\">Not translated</th></tr>\n"; |
| 618 |
|
print HTMLI "</thead>"; |
| 619 |
|
print HTMLI "<tbody>"; |
| 620 |
foreach $lang (@search_in) { |
foreach $lang (@search_in) { |
| 621 |
next if $lang eq 'english'; |
next if $lang eq 'english'; |
| 622 |
my @processed_langs = ($langs{$lang}); |
my @processed_langs = ($langs{$lang}); |
| 623 |
@processed_langs = ("zh-cn", "zh-tw") if $langs{$lang} eq "zh"; |
@processed_langs = ("zh-cn", "zh-tw") if $langs{$lang} eq "zh"; |
| 624 |
foreach $l (@processed_langs) { |
foreach $l (@processed_langs) { |
| 625 |
print HTML "<tr>"; |
print HTMLI "<tr>"; |
| 626 |
printf HTML "<td><a href=\"%s.html#gettext\">%s</a> (%s)</td>", $l, ucfirst $lang, $l; |
printf HTMLI "<th><a href=\"%s.html#gettext\">%s</a> (%s)</th>", $l, ucfirst $lang, $l; |
| 627 |
$color_t = get_color ($percent_po_t{'total'}{$lang}); |
$color_t = get_color ($percent_po_t{'total'}{$lang}); |
| 628 |
$color_f = get_color (100 - $percent_po_f{'total'}{$lang}); |
$color_f = get_color (100 - $percent_po_f{'total'}{$lang}); |
| 629 |
$color_u = get_color (100 - $percent_po_u{'total'}{$lang}); |
$color_u = get_color (100 - $percent_po_u{'total'}{$lang}); |
| 630 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_t, $po_translated{'total'}{$lang}, format3($percent_po_t{'total'}{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_t, $po_translated{'total'}{$lang}, format3($percent_po_t{'total'}{$lang}); |
| 631 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, format3($percent_po_f{'total'}{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_f, $po_fuzzy{'total'}{$lang}, format3($percent_po_f{'total'}{$lang}); |
| 632 |
printf HTML "<td bgcolor=\"%s\" align=right>%d</td><td>(%s%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, format3($percent_po_u{'total'}{$lang}); |
printf HTMLI "<td style=\"background-color: %s\">%d</td><td>(%s%%)</td>", $color_u, $po_untranslated{'total'}{$lang}, format3($percent_po_u{'total'}{$lang}); |
| 633 |
print HTML "</tr>\n"; |
print HTMLI "</tr>\n"; |
| 634 |
} |
} |
| 635 |
} |
} |
| 636 |
|
|
| 637 |
print HTML "</table>\n"; |
print HTMLI "</tbody>"; |
| 638 |
print HTML $border_foot; |
print HTMLI "</table>\n"; |
| 639 |
|
# print HTMLI $border_foot; |
| 640 |
print HTML "<p><hr noshade size=1 width=\"100%\">\n"; |
|
| 641 |
print HTML "<p>Created with <a href=\"http://cvs.debian.org/webwml/stattrans.pl?cvsroot=webwml\">webwml-stattrans</a> at $date\n"; |
print HTMLI "<p><hr>\n"; |
| 642 |
print HTML "</body></html>\n"; |
print HTMLI "<p>Created with <a href=\"http://cvs.debian.org/webwml/stattrans.pl?cvsroot=webwml\">webwml-stattrans</a> at $date\n"; |
| 643 |
close (HTML); |
print HTMLI "</body></html>\n"; |
| 644 |
|
close (HTMLI); |
| 645 |
|
|
| 646 |
print "done.\n" if ($config{'verbose'}); |
print "done.\n" if ($config{'verbose'}); |
| 647 |
|
|