| 1 |
#!/usr/bin/perl -w
|
| 2 |
#
|
| 3 |
# "Count" languages for which a translation is available in the DDP
|
| 4 |
# useful for presentations :-)
|
| 5 |
#
|
| 6 |
# (c) 2006 Javier Fernandez-Sanguino, jfs@debian.org
|
| 7 |
#
|
| 8 |
# This code is distributed under the GNU GPL version 2
|
| 9 |
#
|
| 10 |
open (LIST,'find . -name "*.??.sgml" -o -name "*.??_??.sgml" |') or die ("Cannot execute: $?");
|
| 11 |
while (<LIST>) {
|
| 12 |
chomp;
|
| 13 |
$langs{$1} ++ if /.*?\.(\w{2}|\w{2}_\w{2})\.sgml/;
|
| 14 |
}
|
| 15 |
close LIST;
|
| 16 |
open (LIST,'find . -type d -name "??" -o -name "??_??" |') or die ("Cannot execute: $?");
|
| 17 |
while (<LIST>) {
|
| 18 |
chomp;
|
| 19 |
$langs{$1} ++ if /^\.\/(\w+)\/(\w{2}|\w{2}_\w{2})$/;
|
| 20 |
}
|
| 21 |
close LIST;
|
| 22 |
|
| 23 |
|
| 24 |
foreach $lang (sort { $langs{$b} <=> $langs{$a} } keys %langs) {
|
| 25 |
print $lang." ";
|
| 26 |
print "+"x$langs{$lang};
|
| 27 |
print "\n";
|
| 28 |
}
|
| 29 |
|