annotate po/update.pl @ 9358:5a9155e564d6

[gaim-migrate @ 10166] updated committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 23 Jun 2004 15:12:02 +0000
parents ea261ce36f0b
children 06fe6ed7f63a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5180
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 #!/usr/bin/perl -w
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 # GNOME po update utility.
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 # (C) 2000 The Free Software Foundation
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 #
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 # Author(s): Kenneth Christiansen
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 $VERSION = "1.2.5 beta 2";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 $LANG = $ARGV[0];
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 $PACKAGE = "gaim";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 if (! $LANG){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 print "update.pl: missing file arguments\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 print "Try `update.pl --help' for more information.\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 exit;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 if ($LANG=~/^-(.)*/){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 if ("$LANG" eq "--version" || "$LANG" eq "-V"){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 print "GNOME PO Updater $VERSION\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 print "Written by Kenneth Christiansen <kenneth\@gnome.org>, 2000.\n\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 print "Copyright (C) 2000 Free Software Foundation, Inc.\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 print "This is free software; see the source for copying conditions. There is NO\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26 print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 exit;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 elsif ($LANG eq "--help" || "$LANG" eq "-H"){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 print "Usage: ./update.pl [OPTIONS] ...LANGCODE\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 print "Updates pot files and merge them with the translations.\n\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
34 print " -V, --version shows the version\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35 print " -H, --help shows this help page\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 print " -P, --pot only generates the potfile\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37 print " -M, --maintain search for missing files in POTFILES.in\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 print "\nExamples of use:\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39 print "update.sh --pot just creates a new pot file from the source\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 print "update.sh da created new pot file and updated the da.po file\n\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 print "Report bugs to <kenneth\@gnome.org>.\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 exit;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 elsif($LANG eq "--pot" || "$LANG" eq "-P"){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 print "Building the $PACKAGE.pot ...";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 $b="xgettext --default-domain\=$PACKAGE --directory\=\.\."
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 ." --add-comments --keyword\=\_ --keyword\=N\_"
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51 ." --files-from\=\.\/POTFILES\.in ";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
52 $b1="test \! -f $PACKAGE\.po \|\| \( rm -f \.\/$PACKAGE\.pot "
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
53 ."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
54
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
55 `$b`;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
56 `$b1`;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 print "...done\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
60 exit;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 elsif ($LANG eq "--maintain" || "$LANG" eq "-M"){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 $a="find ../ -print | egrep '.*\\.(c|y|cc|c++|h|gob)' ";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 open(BUF2, "POTFILES.in") || die "update.pl: there's not POTFILES.in!!!\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 print "Searching for missing _(\" \") entries...\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 open(BUF1, "$a|");
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 @buf2 = <BUF2>;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73 @buf1 = <BUF1>;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 if (-s "POTFILES.ignore"){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 open FILE, "POTFILES.ignore";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 while (<FILE>) {
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 if ($_=~/^[^#]/o){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 push @bup, $_;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 print "POTFILES.ignore found! Ignoring files...\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 @buf2 = (@bup, @buf2);
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 foreach my $file (@buf1){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 open FILE, "<$file";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 while (<FILE>) {
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 if ($_=~/_\(\"/o){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 $file = unpack("x3 A*",$file) . "\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 push @buff1, $file;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 last;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 @bufff1 = sort (@buff1);
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99 @bufff2 = sort (@buf2);
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101 my %in2;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
102 foreach (@bufff2) {
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
103 $in2{$_} = 1;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
104 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
105
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
106 foreach (@bufff1){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
107 if (!exists($in2{$_})){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
108 push @result, $_ }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
109 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
110
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
111 if(@result){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112 open OUT, ">POTFILES.in.missing";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 print OUT @result;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 print "\nHere are the results:\n\n", @result, "\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115 print "File POTFILES.in.missing is being placed in directory...\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
116 print "Please add the files that should be ignored in POTFILES.ignore\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
117 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
118 else{
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
119 print "\nWell, it's all perfect! Congratulation!\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
120 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
124 else{
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 print "update.pl: invalid option -- $LANG\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126 print "Try `update.pl --help' for more information.\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 exit;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
130
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
131 elsif(-s "$LANG.po"){
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
132
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
133 print "Building the $PACKAGE.pot ...";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
134
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
135 $c="xgettext --default-domain\=$PACKAGE --directory\=\.\."
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
136 ." --add-comments --keyword\=\_ --keyword\=N\_"
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
137 ." --files-from\=\.\/POTFILES\.in ";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
138 $c1="test \! -f $PACKAGE\.po \|\| \( rm -f \.\/$PACKAGE\.pot "
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
139 ."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
141 `$c`;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
142 `$c1`;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
143
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 print "...done";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
145
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
146 print "\nNow merging $LANG.po with $PACKAGE.pot, and creating an updated $LANG.po ...\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
147
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
148
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
149 $d="mv $LANG.po $LANG.po.old && msgmerge $LANG.po.old $PACKAGE.pot -o $LANG.po";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
150
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
151 $f="msgfmt --statistics $LANG.po";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
153 `$d`;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
154 `$f`;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
155
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
156 unlink "messages";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
157 unlink "$LANG.po.old";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
159 exit;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
160 }
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
161
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162 else{
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
163 print "update.pl: sorry $LANG.po does not exist!\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
164 print "Try `update.pl --help' for more information.\n";
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
165 exit;
ea261ce36f0b [gaim-migrate @ 5544]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166 }