# HG changeset patch # User Nathan Walp # Date 1065679032 0 # Node ID 25e78bf033be2224dc34fa74c8587cddf1f100fe # Parent 35f92559a4a1de357c44cf269b7ad666e730801a [gaim-migrate @ 7771] might as well stick this ugly code in cvs for all to shame me for ;-) committer: Tailor Script diff -r 35f92559a4a1 -r 25e78bf033be po/stats.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/po/stats.pl Thu Oct 09 05:57:12 2003 +0000 @@ -0,0 +1,81 @@ +#!/usr/bin/perl + +# Copyright 2003 Nathan Walp +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 50 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + + +use Locale::Language; + +$lang{pt_BR} = "Portuguese (Brizillian)"; +$lang{pt_PT} = "Portuguese (Portugal)"; +$lang{'sr@Latn'} = "Serbian (Latin)"; +$lang{zh_CN} = "Chinese (Simplified)"; +$lang{zh_TW} = "Chinese (Traditional)"; + +opendir(DIR, ".") || die "can't open directory: $!"; +@pos = grep { /\.po$/ && -f } readdir(DIR); +foreach (@pos) { s/\.po$//; }; +closedir DIR; + +@pos = sort @pos; + +$now = `date`; + +system("./update.pl --pot > /dev/null"); + +$_ = `msgfmt --statistics gaim.pot -o /dev/null 2>&1`; + +die "unable to get total: $!" unless (/(\d+) untranslated messages/); + +$total = $1; + +print "\n"; +print "\n"; +print "
\n"; + +print"\n"; + +foreach $index (0 .. $#pos) { + $trans = $fuzz = $untrans = 0; + $po = $pos[$index]; + $_ = `msgfmt --statistics $po -o /dev/null 2>&1`; + chomp; + if(/(\d+) translated messages/) { $trans = $1; } + if(/(\d+) fuzzy translations/) { $fuzz = $1; } + if(/(\d+) untranslated messages/) { $untrans = $1; } + $gone = $total - $trans - $fuzz - $untrans; + $gonep = 100 * $gone / $total; + $transp = 100 * $trans / $total; + $fuzzp = 100 * $fuzz / $total; + $untransp = 100 * $untrans / $total; + if($index % 2) { + $color = " bgcolor='#e0e0e0'"; + } else { + $color = " bgcolor='#d0e0ff'"; + } + $name = ""; + $name = $lang{$po}; + $name = code2language($po) unless $name ne ""; + $name = "???" unless $name ne ""; + printf "\n", + $name, $po, $trans, $transp, $fuzz, $fuzzp, $untrans, $untransp, $gone, $gonep, $transp*2, $fuzzp*2, $untransp*2, $gonep*2; +} +print "
languagetrans%fuzzy%untrans%missing% 
%s(%s.po)%d%0.2f%d%0.2f%d%0.2f%d%0.2f
\n"; +print "Latest gaim.pot generated $now: gaim.pot
\n"; +print "\n"; +print "\n"; +