Mercurial > pidgin.yaz
annotate po/stats.pl @ 31336:e9e41a04513d
merge of '5e579d58062410991f6268b66906fb7434730423'
and '7eb555d9d20df94a7bef577253c8effb724ab484'
author | ivan.komarov@soc.pidgin.im |
---|---|
date | Tue, 02 Nov 2010 20:51:44 +0000 |
parents | 1d5f8e977b54 |
children | 6caa1318af63 |
rev | line source |
---|---|
22015
72f90ea7ae34
Don't assume perl is at /usr/bin/perl, use /usr/bin/env instead. This is not
Richard Laager <rlaager@wiktel.com>
parents:
20738
diff
changeset
|
1 #!/usr/bin/env perl |
7202 | 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 | |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17836
diff
changeset
|
17 # Foundation, Inc., 50 Temple Place, Suite 330, Boston, MA 02111-1301 USA |
7202 | 18 # |
19 | |
11466 | 20 use POSIX qw(strftime); |
21 | |
7202 | 22 |
15768 | 23 my $PACKAGE="pidgin"; |
9412 | 24 |
25 | |
7202 | 26 use Locale::Language; |
27 | |
13799 | 28 $lang{'ca@valencia'} = "Catalan (Valencian)"; |
20235
6d15c55ef3cd
applied changes from f6deeedd3d31f0863466fff4c81816aee12122a6
Richard Laager <rlaager@wiktel.com>
parents:
20234
diff
changeset
|
29 $lang{'be@latin'} = "Belarusian (Latin)"; |
31077
1d5f8e977b54
I just noticed I didn't differentiate bn_IN from bn when I added this translation.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31055
diff
changeset
|
30 $lang{bn_IN} = "Bengali-India"; |
10058 | 31 $lang{en_AU} = "English (Australian)"; |
8860 | 32 $lang{en_CA} = "English (Canadian)"; |
8033 | 33 $lang{en_GB} = "English (British)"; |
31055
96f07cef738d
Stu says adding this will make the l10n page show the language name for the code mai.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
29016
diff
changeset
|
34 $lang{mai} = "Maithili"; |
29016
f5e31099a351
Added Malay translation from Muhammad Najmi bin Ahmad Zabidi. Closes #10578.
Paul Aurich <paul@darkrain42.org>
parents:
24169
diff
changeset
|
35 $lang{ms_MY} = "Malay"; |
11472 | 36 $lang{my_MM} = "Burmese (Myanmar)"; |
7548 | 37 $lang{pt_BR} = "Portuguese (Brazilian)"; |
20738
54fa708ba54f
sr@Latn changed to sr@latin
Luke Schierer <lschiere@pidgin.im>
parents:
20237
diff
changeset
|
38 $lang{'sr@latin'} = "Serbian (Latin)"; |
7202 | 39 $lang{zh_CN} = "Chinese (Simplified)"; |
17836
ae3c3de19ba8
Teach stats.pl about zh_HK
Stu Tomlinson <stu@nosnilmot.com>
parents:
15768
diff
changeset
|
40 $lang{zh_HK} = "Chinese (Hong Kong)"; |
7202 | 41 $lang{zh_TW} = "Chinese (Traditional)"; |
42 | |
43 opendir(DIR, ".") || die "can't open directory: $!"; | |
44 @pos = grep { /\.po$/ && -f } readdir(DIR); | |
45 foreach (@pos) { s/\.po$//; }; | |
46 closedir DIR; | |
47 | |
48 @pos = sort @pos; | |
49 | |
50 $now = `date`; | |
51 | |
13185
87d9db90bf6e
[gaim-migrate @ 15548]
Richard Laager <rlaager@wiktel.com>
parents:
11472
diff
changeset
|
52 system("intltool-update --pot > /dev/null"); |
7202 | 53 |
9412 | 54 $_ = `msgfmt --statistics $PACKAGE.pot -o /dev/null 2>&1`; |
7202 | 55 |
56 die "unable to get total: $!" unless (/(\d+) untranslated messages/); | |
57 | |
58 $total = $1; | |
11466 | 59 $generated = strftime "%Y-%m-%d %H:%M:%S", gmtime; |
7202 | 60 |
11361 | 61 print "<?xml version='1.0'?>\n"; |
62 print "<?xml-stylesheet type='text/xsl' href='l10n.xsl'?>\n"; | |
11466 | 63 print "<project version='1.0' xmlns:l10n='http://faceprint.com/code/l10n' name='$PACKAGE' pofile='$PACKAGE.pot' strings='$total' generated='$generated'>\n"; |
7202 | 64 |
65 foreach $index (0 .. $#pos) { | |
66 $trans = $fuzz = $untrans = 0; | |
67 $po = $pos[$index]; | |
7739 | 68 print STDERR "$po..." if($ARGV[0] eq '-v'); |
24169
f79b6c9b82a5
Pass --no-location to msgmerge when generating the stats at
Mark Doliner <mark@kingant.net>
parents:
22015
diff
changeset
|
69 system("msgmerge --no-location -U $po.po $PACKAGE.pot 2>/dev/null"); |
20234
a02994afdb43
applied changes from 4dd446ee59f869036e9065d0f45270444f319f1d
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
70 if (($? & 127) == 2) { |
a02994afdb43
applied changes from 4dd446ee59f869036e9065d0f45270444f319f1d
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
71 printf STDERR "Caught keyboard interrupt--exiting\n"; |
a02994afdb43
applied changes from 4dd446ee59f869036e9065d0f45270444f319f1d
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
72 exit |
a02994afdb43
applied changes from 4dd446ee59f869036e9065d0f45270444f319f1d
Richard Laager <rlaager@wiktel.com>
parents:
19680
diff
changeset
|
73 } |
20237
b1d14929fda1
applied changes from 71a27720e49364f4f24fc09309442fc3a2c17bc9
Richard Laager <rlaager@wiktel.com>
parents:
20235
diff
changeset
|
74 $_ = `msgfmt --statistics $po -o /dev/null 2>&1`; |
7202 | 75 chomp; |
9765 | 76 if(/(\d+) translated message/) { $trans = $1; } |
77 if(/(\d+) fuzzy translation/) { $fuzz = $1; } | |
78 if(/(\d+) untranslated message/) { $untrans = $1; } | |
11361 | 79 |
11472 | 80 $name = ""; |
81 $name = $lang{$po}; | |
82 $name = code2language($po) unless $name ne ""; | |
83 $name = "???" unless $name ne ""; | |
84 | |
85 print "<lang code='$po' name='$name' translated='$trans' fuzzy='$fuzz' />\n"; | |
8060 | 86 print STDERR "done ($untrans untranslated strings).\n" if($ARGV[0] eq '-v'); |
7202 | 87 } |
88 | |
11361 | 89 print "</project>\n"; |
90 |