| Language |
Complete |
Translators |
<:
my $alb = "/data/proj/album/album";
$alb = "/WWW/web/MarginalHacks.com/bin/album" unless -x $alb;
$alb = "album" unless -x $alb;
sub nowrap {
my (@str) = @_;
map { "$_"; } @str;
}
sub percent {
my ($perc) = @_;
my $width = 200;
my $fin = $width/100*$perc;
my $unfin = $width/100*(100-$perc);
my @ret;
push(@ret, "");
push(@ret, "| $perc\% | ");
push(@ret, " | ") if $unfin;
push(@ret, " ");
return join("\n",@ret);
}
open(LIST,"$alb -list_langs |") || die("Couldn't run $alb -list_langs\n");
my $plugins = 0;
my $show = 1;
while () {
next if /Available languages:/;
if (/^\s+(\S+):\s*(\S.*?)\s*\((.+)\)$/) {
my ($code,$lang,$eng_lang) = ($1,$2,$3);
my $comp = scalar ;
die("Couldn't understand completion line:\n$_")
unless $comp =~ /Complete:\s*([\d\.]+)%\s+HTML:\s([\d\.]+)%/;
my ($complete,$html) = ($1,$2);
($complete,$html) = (percent($complete),percent($html));
my (@translators);
while () {
last unless /translator:\s*(\S.*?)\s*<([^>]+)>/;
my ($translator,$href) = ($1,$2);
unless ($href =~ m|http://getdave.com/|i) {
$href =~ s|http://||g;
$href = $href =~ /(.+)\@(.+)/ ? "mailto://$1 AT NOSPAM$2" : "/redir.cgi?$href";
}
push(@translators, $href ? "$translator" : $translator);
}
my $translator = join(" ", nowrap(@translators));
print <
|
$code
$lang
($eng_lang)
|
Complete:
|
$complete
|
$translator
|
|
HTML:
|
$html
|
LANG
}
}
:>
|