]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/script/make_pot.pl
ebl update to use the new gettext method
[bacula/bacula] / gui / bweb / script / make_pot.pl
1 #!/usr/bin/perl -w
2 use strict;
3 use Getopt::Long;
4
5 # Usage: $0 *.po *.tpl
6 #my $src = shift or die "Usage $0 pofile";
7 #
8 #my $tab;
9 #{
10 #    no strict;
11 #    $tab = eval `cat $src`;
12 #}
13
14 open(OUT, "|msguniq > bweb.pot");
15
16 foreach my $f (@ARGV)
17 {
18     next if (! -f $f) ;
19
20     open(FP, $f) or print STDERR "Can't open $f for reading\n";
21     while (my $l = <FP>)
22     {
23         if ($l =~ m/__(.+?)__/) {
24             my $s = $1;
25             my $r = ''; #$tab->{$s} || $s;
26             $s =~ s/\n/\\n/g;
27             $s =~ s/"/\\"/g;
28 #           $r =~ s/\n/\\n/g;
29 #           $r =~ s/"/\\"/g;
30             print OUT "#: $f:$.\n";
31             print OUT "msgid \"$s\"\n";
32             print OUT "msgstr \"$r\"\n\n";
33         }
34     }
35     close(FP);
36 }
37
38 close(OUT);
39 # msginit  pot -> lang.po
40 # msgmerge fr.po bweb.pot