trunk 20080912
[gitenigma.git] / po / xml2po
blobba472e9c782228a615c1e048acb2a274e4a9da38
1 #! /usr/bin/perl
2 use strict;
3 use warnings;
5 my %used;
6 my ($list, $fh);
8 open($list, $ARGV[0]) or die "cannot open list";
10 chdir $ARGV[1];
12 while (<$list>) {
13 my $xmlpath=$_;
14 my $xmlfile=`basename $xmlpath`;
15 chomp $xmlfile;
17 open ($fh, "<$xmlpath") or die "cannot open file $xmlpath";
19 my $line=1;
20 while (<$fh>) {
21 while (s/(\w+)=\"(.*?)\"//) {
22 if ($1 eq "text" or $1 eq "helptext")
24 $used{$2} .= "#: $xmlfile:$line\n";
27 $line++;
29 close ($fh);
32 for (keys %used) {
33 print "$used{$_}msgid \"$_\"\nmsgstr \"\"\n\n"