Skip to content

Commit 012bd99

Browse files
committed
scripts/tsstat.pl: remove unused site mode and add note to doc/TRANSLATORS
1 parent c4b3cbc commit 012bd99

File tree

1 file changed

+22
-51
lines changed

1 file changed

+22
-51
lines changed

scripts/tsstat.pl

+22-51
Original file line numberDiff line numberDiff line change
@@ -171,58 +171,29 @@
171171
$l->{percentage} = ($l->{finished}+$l->{unfinished}/2)/$maxn*100;
172172
}
173173

174-
if ( @ARGV && $ARGV[0] eq "site") {
175-
print "<html><body>";
176-
print "<head>";
177-
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>";
178-
print "<style>";
179-
print "body {font-family:sans-serif; background-color:#d3d3d3; }";
180-
print "table {font-size:80%;border-collapse: collapse;}";
181-
print "td {border-left:solid 1px #aaaaaa;border-right:solid 1px #aaaaaa;padding:1px 10px;}";
182-
print ".bartodo{ background-color:red;width:100px;height:20px;}";
183-
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
184-
print "</style></head>";
185-
print "<table>";
186-
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";
187-
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
188-
last if $l->{percentage} < 35;
189-
printf "\n<tr>"
190-
. '<td align="center"><img src="flags/%s.svg" height="20"></td><td nowrap>%s</td>'
191-
. '<td nowrap>%s</td><td>%d</td><td>%d</td><td>%d</td>'
192-
. '<td><div class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
193-
. '<td>%s</td>'
194-
. '</tr>',
195-
$l->{code}, $l->{name},
196-
$l->{diff}==0 ? $l->{n} : "$l->{n} ($l->{diff})",
197-
$l->{finished}, $l->{unfinished}, $l->{untranslated},
198-
$l->{percentage}, $l->{percentage},
199-
$l->{translator};
200-
}
201-
print "</table></body></html>\n";
202-
} else {
203-
print "<style>";
204-
print "body { font-family:sans-serif; background-color:#d3d3d3; }";
205-
print "table {font-size:80%;}";
206-
print "th {text-align:left; }";
207-
print ".bartodo{ background-color:red;width:100px;height:20px;}";
208-
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
209-
print "</style>";
210-
print "<table>";
211-
print "<tr><th colspan=\"2\" style=\"width:250px;\">Language</th><th>Finished %</th><th>Translators</th></tr>\n";
212-
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
213-
last if $l->{percentage} < 35;
214-
printf "\n<tr>"
215-
. '<td align="center"><img src="qrc:/images/flags/%s.svg" height="20"></td><td>%s</td>'
216-
. '<td><div title="finished:%d unfinished:%d untranslated:%d" class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
217-
. '<td>%s</td>'
218-
. '</tr>',
219-
$l->{code}, $l->{name},
220-
$l->{finished}, $l->{unfinished}, $l->{untranslated},
221-
$l->{percentage}, $l->{percentage},
222-
$l->{translator};
223-
}
224-
print "</table>\n";
174+
print "<!-- created by scripts/tsstat.pl - Edits will be lost -->\n";
175+
print "<style>";
176+
print "body { font-family:sans-serif; background-color:#d3d3d3; }";
177+
print "table {font-size:80%;}";
178+
print "th {text-align:left; }";
179+
print ".bartodo{ background-color:red;width:100px;height:20px;}";
180+
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
181+
print "</style>";
182+
print "<table>";
183+
print "<tr><th colspan=\"2\" style=\"width:250px;\">Language</th><th>Finished %</th><th>Translators</th></tr>\n";
184+
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
185+
last if $l->{percentage} < 35;
186+
printf "\n<tr>"
187+
. '<td align="center"><img src="qrc:/images/flags/%s.svg" height="20"></td><td>%s</td>'
188+
. '<td><div title="finished:%d unfinished:%d untranslated:%d" class="bartodo"><div class="bardone" style="width:%dpx">%.1f</div></div></td>'
189+
. '<td>%s</td>'
190+
. '</tr>',
191+
$l->{code}, $l->{name},
192+
$l->{finished}, $l->{unfinished}, $l->{untranslated},
193+
$l->{percentage}, $l->{percentage},
194+
$l->{translator};
225195
}
196+
print "</table>\n";
226197

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

0 commit comments

Comments
 (0)