2008-10-18 [paul] 3.6.1cvs9
[claws.git] / tools / claws.i18n.status.pl
index 9e83f57e51f743963f562ad2be3c90f4954cb581..57da77f852644d9ab7a8f95c1746cb474a5a8bcd 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 #
-# claws.i18n.stats.pl - Generate statistics for Sylpheed Claws po directory.
+# claws.i18n.stats.pl - Generate statistics for Claws Mail po directory.
 # 
 # (c) 2003 by Ricardo Mones Lastra <mones@aic.uniovi.es>
 # This program is released under the GNU General Public License.
 %langname = (
        'bg.po' => 'Bulgarian',
        'ca.po' => 'Catalan',
-       'cs.po' => 'Czech',
        'de.po' => 'German',
-       'el.po' => 'Greek',
        'en_GB.po' => 'British English',
        'es.po' => 'Spanish',
        'fi.po' => 'Finnish',
        'fr.po' => 'French',
-       'hr.po' => 'Croatian',
        'hu.po' => 'Hungarian',
        'it.po' => 'Italian',
-       'ja.po' => 'Japanese',
-       'ko.po' => 'Korean',
-       'nb.po' => 'Norwegian',
        'nl.po' => 'Dutch',
        'pl.po' => 'Polish',
        'pt_BR.po' => 'Brazilian Portuguese',
        'sr.po' => 'Serbian',
        'sv.po' => 'Swedish',
        'zh_CN.po' => 'Simpilified Chinese',
-       'zh_TW.Big5.po' => 'Taiwanese',
 );
 
 %lasttranslator = (
-       'bg.po' => 'George Danchev <danchev@spnet.net>',
-       'ca.po' => 'Miquel Oliete <miqueloliete@softhome.net>',
-       'cs.po' => 'Radek Vybíral <Radek.Vybiral@vsb.cz>',
-       'de.po' => 'Thomas Gilgin <thg1@karate-muellheim.de>',
-       'el.po' => 'Michalis Kabrianis <Michalis@bigfoot.com>',
-       'en_GB.po' => 'Paul Mangan <claws@thewildbeast.co.uk>',
-       'es.po' => 'Ricardo Mones Lastra <mones@aic.uniovi.es>',
+       'bg.po' => 'Yasen Pramatarov <yasen@lindeas.com>',
+       'ca.po' => 'Miquel Oliete <ktalanet@yahoo.es>',
+       'de.po' => 'Stephan Sachse <white@dev-zero.com>',
+       'en_GB.po' => 'Paul Mangan <paul@claws-mail.org>',
+       'es.po' => 'Ricardo Mones Lastra <ricardo@mones.org>',
        'fi.po' => 'Flammie Pirinen <flammie@iki.fi>',
-       'fr.po' => 'Fabien Vantard <fzzzzz@gmail.com>',
-       'hr.po' => 'Dragan Leskovar <drleskov@inet.hr>',
-       'hu.po' => 'Gál Zoltán <galzoli@hu.inter.net>',
+       'fr.po' => 'Tristan Chabredier <wwp@claws-mail.org>',
+       'hu.po' => 'P&aacute;der Rezs&#337; <rezso@rezso.net>',
        'it.po' => 'Andrea Spadaccini <a.spadaccini@catania.linux.it>',
-       'ja.po' => 'Rui Hirokawa <rui_hirokawa@ybb.ne.jp>',
-       'ko.po' => 'ChiDeok, Hwang <hwang@mizi.co.kr>',
-       'nb.po' => 'Geir Helland <pjallabais@users.sourceforge.net>',
-       'nl.po' => 'Wilbert Berendsen <wbsoft@xs4all.nl>',
-       'pl.po' => 'Emilian Nowak <eminowbl@posejdon.wpk.p.lodz.pl>',
+       'nl.po' => 'Marcel Pol <mpol@gmx.net>',
+       'pl.po' => 'Emilian Nowak <emil5@go2.pl>',
        'pt_BR.po' => 'Frederico Goncalves Guimaraes <fggdebian@yahoo.com.br>',
-       'ru.po' => 'Pavlo Bohmat <bohm@ukr.net>',
+       'ru.po' => 'Aleksei Miheev <aleksei@miheev.info>',
        'sk.po' => 'Andrej Kacian <andrej@kacian.sk>',
-       'sr.po' => 'urke <urke@users.sourceforge.net>',
-       'sv.po' => 'Joakim Andreasson <joakim.andreasson@gmx.net>',
-       'zh_CN.po' => 'Hansom Young <glyoung@users.sourceforge.net>',
-       'zh_TW.Big5.po' => 'Tsu-Fan Cheng <tscheng@ic.sunysb.edu>',
+       'sr.po' => 'Aleksandar Urosevic <urke@users.sf.net>',
+       'sv.po' => 'Lars Persson Fink <lars.p.fink@gmail.com>',
+       'zh_CN.po' => 'Ralgh Young <bamanzi@gmail.com>',
 );
 
 %barcolornorm = (
        completed => 'red',
 );
 
-$barwidth = 300; # pixels
+$barwidth = 500; # pixels
 $barheight = 12; # pixels
 
-$transolddays = 90;    # days to consider a translation is old, so probably unmaintained. 
+$transolddays = 90;    # days to consider a translation is old, so probably unmaintained.
+$transoldmonths = $transolddays / 30;
 $transneedthresold = 0.75; # percent/100
 
 $msgfmt = '/usr/bin/msgfmt';
@@ -113,7 +100,7 @@ $cage = get_trans_age($year,$mon,$mday); # get current "age"
 
 # drawing a language status row
 sub print_lang {
-       my ($lang, $person, $trans, $fuzzy, $untrans, $tage) = @_;
+       my ($lang, $person, $trans, $fuzzy, $untrans, $tage, $oddeven) = @_;
        $total = $trans + $fuzzy + $untrans;
        if ($tage == 0) { $tage = $cage; } # hack for average translation
        print STDERR $cage, " ",  $tage, "\n";
@@ -124,7 +111,9 @@ sub print_lang {
        }
        $_ = $person;
        if (/(.+)\s+\<(.+)\>/) { $pname = $1; $pemail = $2; } else { $pname = $pemail = $contactaddress; }
-       print "<tr>\n<td>\n";
+       print "<tr";
+       if ($oddeven > 0) { print " bgcolor=#EFEFEF"; }
+       print ">\n<td>\n";
        if ($lang eq $averagestr) {
                print "<b>$lang</b>";
        } else {
@@ -152,7 +141,7 @@ sub tens {
 get_current_date();
 
 # get project version from changelog (project dependent code :-/ )
-$_ = `head -1 ../ChangeLog-gtk2.claws`;
+$_ = `head -1 ../ChangeLog`;
 if (/\S+\s+\S+\s+(\S+)/) { $genversion = $1; } else { $genversion = 'Unknown'; }
 
 $numlang = keys(%langname);
@@ -165,10 +154,18 @@ $numlang = keys(%langname);
 #ENDOFHEAD
 
 # start
-print "<div class=indent>\n<b>Translation Status (on $datetimenow for $genversion)</b>\n<div class=indent>\n<table cellspacing=0 cellpadding=2>\n";
+print qq ~<div class=indent>
+          <b>Translation Status (on $datetimenow for $genversion)</b>
+         <div class=indent>
+               <table cellspacing=0 cellpadding=2>~;
 
 # table header
-print "<tr bgcolor=#cccccc>\n<th align=left>Language</th>\n<th>Translated|Fuzzy|Untranslated</th>\n<th>Percent</th>\n<th>\n</th>\n</tr>\n";
+print qq ~<tr bgcolor=#cccccc>
+         <th align=left>Language</th>
+         <th>Translated|Fuzzy|Untranslated</th>
+         <th>Percent</th>
+         <th></th>
+         </tr>~;
 
 # get files
 opendir(PODIR, ".") || die("Error: can't open current directory\n");
@@ -177,10 +174,10 @@ closedir(PODIR);
 
 @sorted_pofiles = sort(@pofiles);
 # iterate them
-$alang = $atran = $afuzz = $auntr = 0;
+$alang = $atran = $afuzz = $auntr = $oddeven = 0;
 foreach $pofile (@sorted_pofiles) {
        $_ = $pofile;
-       if (/.+\.po$/) {
+       if (/.+\.po$/ && defined($langname{$pofile}) ) {
                print STDERR "Processing $_\n"; # be a little informative
                ++$alang;
                $transage = $tran = $fuzz = $untr = 0;
@@ -202,23 +199,34 @@ foreach $pofile (@sorted_pofiles) {
                if (/\s+(\d+)\-(\d+)\-(\d+)/) { 
                        $transage = get_trans_age($1,$2,$3); 
                }
-               print_lang($langname{$pofile},$lasttranslator{$pofile},$tran,$fuzz,$untr,$transage);
+               print_lang($langname{$pofile},$lasttranslator{$pofile},$tran,$fuzz,$untr,$transage, $oddeven);
+               if ($oddeven == 1) { $oddeven = 0 } else { $oddeven++; } 
        }
 }
 
 # average results for the project
 print "<tr>\n<td colspan=3 height=8></td>\n<tr>";
-print_lang($averagestr,'',$atran,$afuzz,$auntr,0);
+print_lang($averagestr,'',$atran,$afuzz,$auntr,0,0);
        
 # table footer
 print "</table>\n";
 
 # end
 # print "<br>Number of languages supported: $alang <br>";
-print "<p>\nLanguages marked with <font size=\"+1\" color=\"red\"> *</font> really need your help to be completed.<br>";
-print "<p>The ones with grey bars are <i>probably unmaintained</i> because translation is more than ", $transolddays / 30, " months old, anyway, trying to contact current translator first is usually a good idea before submitting an updated one.<p><b>NOTE</b>: if you are the translator of one of them and don't want to see your language bar in grey you should manually update the <tt>PO-Revision-Date</tt> field in the .po file header (or, alternatively, use a tool which does it for you).<br>";
-# print "If you want to help those or contribute any new language please contact <a href=\"mailto:$contactaddress\">us</a>.";
-print "</div></div>";
+print qq ~<p>
+         Languages marked with <font size="+1" color="red"> *</font>
+         really need your help to be completed.
+          <p>
+         The ones with grey bars are <i>probably unmaintained</i> because
+          translation is more than $transoldmonths months old, anyway, trying
+         to contact current translator first is usually a good idea before
+         submitting an updated one.<p><b>NOTE</b>: if you are the translator
+         of one of them and don't want to see your language bar in grey you
+         should manually update the <tt>PO-Revision-Date</tt> field in the .po
+         file header (or, alternatively, use a tool which does it for you).
+         <br>
+         </div>
+         </div>~;
 
 # print `cat $pagetail`;
 #