* statistics.pl: Added a Perl program to print the translation

status.
This commit is contained in:
Roland Illig 2005-07-22 16:21:38 +00:00
parent d6dc8bb3e9
commit 3979b56523
2 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-07-22 Roland Illig <roland.illig@gmx.de>
* statistics.pl: Added a Perl program to print the translation
status.
2005-07-22 Arpad Biro <biro_arpad@yahoo.com>
* hu.po: Updated Hungarian translation.

30
po/statistics.pl Executable file
View File

@ -0,0 +1,30 @@
#! /usr/bin/env perl
use strict;
use warnings;
my $first = 1;
foreach my $f (@ARGV) {
my ($lang, $translated, $fuzzy, $untranslated) = (undef, 0, 0, 0);
# statistics are printed on stderr, as well as error messages.
my $stat = `msgfmt --statistics "$f" 2>&1`;
($lang = $f) =~ s,\.po$,,;
if ($stat =~ qr"(\d+)\s+translated") {
$translated = $1;
}
if ($stat =~ qr"(\d+)\s+fuzzy") {
$fuzzy = $1;
}
if ($stat =~ qr"(\d+)\s+untranslated") {
$untranslated = $1;
}
if ($first) {
printf("%8s %10s %5s %12s\n",
"language", "translated", "fuzzy", "untranslated");
printf("%s\n", "-" x 43);
$first = 0;
}
printf("%8s %10d %5d %12d\n",
$lang, $translated, $fuzzy, $untranslated);
}