Skip to content

Commit

Permalink
scripts/tsstat.pl: remove unused site mode and add note to doc/TRANSL…
Browse files Browse the repository at this point in the history
…ATORS
  • Loading branch information
jef-n committed Oct 27, 2018
1 parent c4b3cbc commit 012bd99
Showing 1 changed file with 22 additions and 51 deletions.
73 changes: 22 additions & 51 deletions scripts/tsstat.pl
Expand Up @@ -171,58 +171,29 @@
$l->{percentage} = ($l->{finished}+$l->{unfinished}/2)/$maxn*100;
}

if ( @ARGV && $ARGV[0] eq "site") {
print "<html><body>";
print "<head>";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>";
print "<style>";
print "body {font-family:sans-serif; background-color:#d3d3d3; }";
print "table {font-size:80%;border-collapse: collapse;}";
print "td {border-left:solid 1px #aaaaaa;border-right:solid 1px #aaaaaa;padding:1px 10px;}";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style></head>";
print "<table>";
print "<tr><td colspan=\"2\" style=\"width:250px;\">Language</td><td>Count</td><td>Finished</td><td>Unfinished</td><td>Untranslated</td><td>Percentage</td><td>Translators</td></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
last if $l->{percentage} < 35;
printf "\n<tr>"
. '<td align="center"><img src="flags/%s.svg" height="20"></td><td nowrap>%s</td>'
. '<td nowrap>%s</td><td>%d</td><td>%d</td><td>%d</td>'
. '<td><div class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
. '<td>%s</td>'
. '</tr>',
$l->{code}, $l->{name},
$l->{diff}==0 ? $l->{n} : "$l->{n} ($l->{diff})",
$l->{finished}, $l->{unfinished}, $l->{untranslated},
$l->{percentage}, $l->{percentage},
$l->{translator};
}
print "</table></body></html>\n";
} else {
print "<style>";
print "body { font-family:sans-serif; background-color:#d3d3d3; }";
print "table {font-size:80%;}";
print "th {text-align:left; }";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style>";
print "<table>";
print "<tr><th colspan=\"2\" style=\"width:250px;\">Language</th><th>Finished %</th><th>Translators</th></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
last if $l->{percentage} < 35;
printf "\n<tr>"
. '<td align="center"><img src="qrc:/images/flags/%s.svg" height="20"></td><td>%s</td>'
. '<td><div title="finished:%d unfinished:%d untranslated:%d" class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
. '<td>%s</td>'
. '</tr>',
$l->{code}, $l->{name},
$l->{finished}, $l->{unfinished}, $l->{untranslated},
$l->{percentage}, $l->{percentage},
$l->{translator};
}
print "</table>\n";
print "<!-- created by scripts/tsstat.pl - Edits will be lost -->\n";
print "<style>";
print "body { font-family:sans-serif; background-color:#d3d3d3; }";
print "table {font-size:80%;}";
print "th {text-align:left; }";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style>";
print "<table>";
print "<tr><th colspan=\"2\" style=\"width:250px;\">Language</th><th>Finished %</th><th>Translators</th></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
last if $l->{percentage} < 35;
printf "\n<tr>"
. '<td align="center"><img src="qrc:/images/flags/%s.svg" height="20"></td><td>%s</td>'
. '<td><div title="finished:%d unfinished:%d untranslated:%d" class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
. '<td>%s</td>'
. '</tr>',
$l->{code}, $l->{name},
$l->{finished}, $l->{unfinished}, $l->{untranslated},
$l->{percentage}, $l->{percentage},
$l->{translator};
}
print "</table>\n";

my @ts;
for my $l (sort { $a->{code} cmp $b->{code} } @lang) {
Expand Down

0 comments on commit 012bd99

Please sign in to comment.