~ubuntu-branches/ubuntu/lucid/mc/lucid

« back to all changes in this revision

Viewing changes to po/statistics.pl

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Winnertz
  • Date: 2008-09-16 10:38:59 UTC
  • mfrom: (3.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080916103859-2uwn8w61xk5mbxxq
Tags: 2:4.6.2~git20080311-4
Corrected fix for odt2txt issue (Closes: #492019) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env perl
 
2
use strict;
 
3
use warnings;
 
4
 
 
5
my $first = 1;
 
6
 
 
7
foreach my $f (@ARGV) {
 
8
        my ($lang, $translated, $fuzzy, $untranslated) = (undef, 0, 0, 0);
 
9
 
 
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;
 
15
        }
 
16
        if ($stat =~ qr"(\d+)\s+fuzzy") {
 
17
                $fuzzy = $1;
 
18
        }
 
19
        if ($stat =~ qr"(\d+)\s+untranslated") {
 
20
                $untranslated = $1;
 
21
        }
 
22
        if ($first) {
 
23
                printf("%8s  %10s  %5s  %12s\n",
 
24
                        "language", "translated", "fuzzy", "untranslated");
 
25
                printf("%s\n", "-" x 43);
 
26
                $first = 0;
 
27
        }
 
28
        printf("%8s  %10d  %5d  %12d\n",
 
29
                $lang, $translated, $fuzzy, $untranslated);
 
30
}