diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-11-14 13:32:27 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-11-14 13:32:27 +0000 |
commit | 100b4731827c03739ee6b1d4ebb8924b303fb91d (patch) | |
tree | f4787cffa48d6067f2877ad3f09bdb6a168229ef /wpo2po.pl | |
parent | 683b057b1597646dc3589871add6e3b662a8ddb1 (diff) | |
download | drakwizard-100b4731827c03739ee6b1d4ebb8924b303fb91d.tar drakwizard-100b4731827c03739ee6b1d4ebb8924b303fb91d.tar.gz drakwizard-100b4731827c03739ee6b1d4ebb8924b303fb91d.tar.bz2 drakwizard-100b4731827c03739ee6b1d4ebb8924b303fb91d.tar.xz drakwizard-100b4731827c03739ee6b1d4ebb8924b303fb91d.zip |
perl_checker fixes
Diffstat (limited to 'wpo2po.pl')
-rw-r--r-- | wpo2po.pl | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -4,7 +4,7 @@ use XML::Parser; sub load_wpo { - my ($tree, $tag ,$page) = @_; + my ($tree, $tag, $page) = @_; foreach my $leaf (@$tree) { if (ref($leaf) eq 'ARRAY') { @@ -18,7 +18,7 @@ sub load_wpo { $leaf->{from} =~ s/\\q/\\\\q/g; $leaf->{from} =~ s/\\a/\\\\a/g; $page->{$leaf->{from}} = $leaf->{to}; - }elsif(ref($leaf)=~ /\w\D/){ + } elsif (ref($leaf) =~ /\w\D/) { $tag = $leaf; } } @@ -50,32 +50,33 @@ my %lang = (fr => '"Language-Team: French <fr@li.org>\n" "Content-Transfer-Encoding: 8bit\n"'); print STDERR "$ARGV[0] =>"; -$ARGV[0] =~ /.*\/(.*)\.(.*)\..*/; +$ARGV[0] =~ m!.*/(.*)\.(.*)\.!; -open(PO, "> ./po/$1_$2.po"); +my $PO; +open($PO, "> ./po/$1_$2.po"); my $date = `date +%Y-%m-%d\\ %H:%M%z`; chomp $date; -print PO 'msgid "" +print $PO 'msgid "" msgstr "" "Project-Id-Version: drakwizard 0.1\n" "POT-Creation-Date: '.$date.'\n" "PO-Revision-Date: '.$date.'\n" "Last-Translator: Arnaud Desmons <adesmons@mandrakesoft.com>\n" -'.$lang{"$2"}.' +'.$lang{$2}.' "X-Generator: wpo2pl 0.1\n" '; -foreach (keys %{$wpo}) { +foreach (keys %$wpo) { if ($_ ne "") { if ($_ eq $wpo->{$_}) { - print PO "msgid \"$_\"\nmsgstr \"\"\n\n"; + print $PO qq(msgid "$_"\nmsgstr ""\n\n); } else { - print PO "msgid \"$_\"\nmsgstr \"$wpo->{$_}\"\n\n"; + print $PO qq(msgid "$_"\nmsgstr "$wpo->{$_}"\n\n); } } } -close PO; +close $PO; print STDERR "./po/$1_$2.po\n"; |