Call va_end after the iteration as we need to free the list again.
[midnight-commander.git] / po / statistics.pl
blob043ba94cb7463fb75f7361d797215345b43a2ef8
1 #! /usr/bin/env perl
2 use strict;
3 use warnings;
5 my $first = 1;
7 foreach my $f (@ARGV) {
8 my ($lang, $translated, $fuzzy, $untranslated) = (undef, 0, 0, 0);
10 # statistics are printed on stderr, as well as error messages.
11 my $stat = `msgfmt --statistics "$f" 2>&1`;
12 ($lang = $f) =~ s,\.po$,,;
13 if ($stat =~ qr"(\d+)\s+translated") {
14 $translated = $1;
16 if ($stat =~ qr"(\d+)\s+fuzzy") {
17 $fuzzy = $1;
19 if ($stat =~ qr"(\d+)\s+untranslated") {
20 $untranslated = $1;
22 if ($first) {
23 printf("%8s %10s %5s %12s\n",
24 "language", "translated", "fuzzy", "untranslated");
25 printf("%s\n", "-" x 43);
26 $first = 0;
28 printf("%8s %10d %5d %12d\n",
29 $lang, $translated, $fuzzy, $untranslated);