Mercurial > pidgin
annotate po/stats.pl @ 18950:f78a9efa9eaf
- Add purple_certificate_register_builtins
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Tue, 26 Jun 2007 19:46:35 +0000 |
parents | ae3c3de19ba8 |
children | 44b4e8bd759b |
rev | line source |
---|---|
7202 | 1 #!/usr/bin/perl |
2 | |
11466 | 3 # Copyright 2003-2005 Nathan Walp <faceprint@faceprint.com> |
7202 | 4 # |
5 # This program is free software; you can redistribute it and/or modify | |
6 # it under the terms of the GNU General Public License as published by | |
7 # the Free Software Foundation; either version 2 of the License, or | |
8 # (at your option) any later version. | |
9 # | |
10 # This program is distributed in the hope that it will be useful, | |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 # GNU General Public License for more details. | |
14 # | |
15 # You should have received a copy of the GNU General Public License | |
16 # along with this program; if not, write to the Free Software | |
17 # Foundation, Inc., 50 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 # | |
19 | |
11466 | 20 use POSIX qw(strftime); |
21 | |
7202 | 22 |
15767 | 23 my $PACKAGE="pidgin"; |
9412 | 24 |
25 | |
7202 | 26 use Locale::Language; |
27 | |
13799 | 28 $lang{'ca@valencia'} = "Catalan (Valencian)"; |
10058 | 29 $lang{en_AU} = "English (Australian)"; |
8860 | 30 $lang{en_CA} = "English (Canadian)"; |
8033 | 31 $lang{en_GB} = "English (British)"; |
11472 | 32 $lang{my_MM} = "Burmese (Myanmar)"; |
7548 | 33 $lang{pt_BR} = "Portuguese (Brazilian)"; |
7202 | 34 $lang{'sr@Latn'} = "Serbian (Latin)"; |
35 $lang{zh_CN} = "Chinese (Simplified)"; | |
17598
ae3c3de19ba8
Teach stats.pl about zh_HK
Stu Tomlinson <stu@nosnilmot.com>
parents:
15767
diff
changeset
|
36 $lang{zh_HK} = "Chinese (Hong Kong)"; |
7202 | 37 $lang{zh_TW} = "Chinese (Traditional)"; |
38 | |
39 opendir(DIR, ".") || die "can't open directory: $!"; | |
40 @pos = grep { /\.po$/ && -f } readdir(DIR); | |
41 foreach (@pos) { s/\.po$//; }; | |
42 closedir DIR; | |
43 | |
44 @pos = sort @pos; | |
45 | |
46 $now = `date`; | |
47 | |
13185
87d9db90bf6e
[gaim-migrate @ 15548]
Richard Laager <rlaager@wiktel.com>
parents:
11472
diff
changeset
|
48 system("intltool-update --pot > /dev/null"); |
7202 | 49 |
9412 | 50 $_ = `msgfmt --statistics $PACKAGE.pot -o /dev/null 2>&1`; |
7202 | 51 |
52 die "unable to get total: $!" unless (/(\d+) untranslated messages/); | |
53 | |
54 $total = $1; | |
11466 | 55 $generated = strftime "%Y-%m-%d %H:%M:%S", gmtime; |
7202 | 56 |
11361 | 57 print "<?xml version='1.0'?>\n"; |
58 print "<?xml-stylesheet type='text/xsl' href='l10n.xsl'?>\n"; | |
11466 | 59 print "<project version='1.0' xmlns:l10n='http://faceprint.com/code/l10n' name='$PACKAGE' pofile='$PACKAGE.pot' strings='$total' generated='$generated'>\n"; |
7202 | 60 |
61 foreach $index (0 .. $#pos) { | |
62 $trans = $fuzz = $untrans = 0; | |
63 $po = $pos[$index]; | |
7739 | 64 print STDERR "$po..." if($ARGV[0] eq '-v'); |
9412 | 65 system("msgmerge $po.po $PACKAGE.pot -o $po.new 2>/dev/null"); |
7739 | 66 $_ = `msgfmt --statistics $po.new -o /dev/null 2>&1`; |
7202 | 67 chomp; |
9765 | 68 if(/(\d+) translated message/) { $trans = $1; } |
69 if(/(\d+) fuzzy translation/) { $fuzz = $1; } | |
70 if(/(\d+) untranslated message/) { $untrans = $1; } | |
7739 | 71 unlink("$po.new"); |
11361 | 72 |
11472 | 73 $name = ""; |
74 $name = $lang{$po}; | |
75 $name = code2language($po) unless $name ne ""; | |
76 $name = "???" unless $name ne ""; | |
77 | |
78 print "<lang code='$po' name='$name' translated='$trans' fuzzy='$fuzz' />\n"; | |
8060 | 79 print STDERR "done ($untrans untranslated strings).\n" if($ARGV[0] eq '-v'); |
7202 | 80 } |
81 | |
11361 | 82 print "</project>\n"; |
83 |