7202
|
1 #!/usr/bin/perl
|
|
2
|
9412
|
3 # Copyright 2003-2004 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
|
|
20
|
9413
|
21 my $PACKAGE="gaim";
|
9412
|
22
|
|
23
|
7202
|
24 use Locale::Language;
|
|
25
|
10058
|
26 $lang{en_AU} = "English (Australian)";
|
8860
|
27 $lang{en_CA} = "English (Canadian)";
|
8033
|
28 $lang{en_GB} = "English (British)";
|
7548
|
29 $lang{pt_BR} = "Portuguese (Brazilian)";
|
7202
|
30 $lang{'sr@Latn'} = "Serbian (Latin)";
|
|
31 $lang{zh_CN} = "Chinese (Simplified)";
|
|
32 $lang{zh_TW} = "Chinese (Traditional)";
|
|
33
|
|
34 opendir(DIR, ".") || die "can't open directory: $!";
|
|
35 @pos = grep { /\.po$/ && -f } readdir(DIR);
|
|
36 foreach (@pos) { s/\.po$//; };
|
|
37 closedir DIR;
|
|
38
|
|
39 @pos = sort @pos;
|
|
40
|
|
41 $now = `date`;
|
|
42
|
|
43 system("./update.pl --pot > /dev/null");
|
|
44
|
9412
|
45 $_ = `msgfmt --statistics $PACKAGE.pot -o /dev/null 2>&1`;
|
7202
|
46
|
|
47 die "unable to get total: $!" unless (/(\d+) untranslated messages/);
|
|
48
|
|
49 $total = $1;
|
|
50
|
11361
|
51 print "<?xml version='1.0'?>\n";
|
|
52 print "<?xml-stylesheet type='text/xsl' href='l10n.xsl'?>\n";
|
|
53 print "<project version='1.0' xmlns:l10n='http://faceprint.com/code/l10n' name='$PACKAGE' pofile='$PACKAGE.pot' strings='$total'>\n";
|
7202
|
54
|
|
55 foreach $index (0 .. $#pos) {
|
|
56 $trans = $fuzz = $untrans = 0;
|
|
57 $po = $pos[$index];
|
7739
|
58 print STDERR "$po..." if($ARGV[0] eq '-v');
|
9412
|
59 system("msgmerge $po.po $PACKAGE.pot -o $po.new 2>/dev/null");
|
7739
|
60 $_ = `msgfmt --statistics $po.new -o /dev/null 2>&1`;
|
7202
|
61 chomp;
|
9765
|
62 if(/(\d+) translated message/) { $trans = $1; }
|
|
63 if(/(\d+) fuzzy translation/) { $fuzz = $1; }
|
|
64 if(/(\d+) untranslated message/) { $untrans = $1; }
|
7739
|
65 unlink("$po.new");
|
11361
|
66
|
|
67 print "<lang code='$po' translated='$trans' fuzzy='$fuzz' />\n";
|
8060
|
68 print STDERR "done ($untrans untranslated strings).\n" if($ARGV[0] eq '-v');
|
7202
|
69 }
|
|
70
|
11361
|
71 print "</project>\n";
|
|
72
|