mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 04:22:34 +03:00
* statistics.pl: Added a Perl program to print the translation
status.
This commit is contained in:
parent
d6dc8bb3e9
commit
3979b56523
@ -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
30
po/statistics.pl
Executable 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user