summaryrefslogtreecommitdiffstats
path: root/wiz2pot.pl
diff options
context:
space:
mode:
Diffstat (limited to 'wiz2pot.pl')
-rwxr-xr-xwiz2pot.pl31
1 files changed, 17 insertions, 14 deletions
diff --git a/wiz2pot.pl b/wiz2pot.pl
index cbd091eb..4b8f2c6d 100755
--- a/wiz2pot.pl
+++ b/wiz2pot.pl
@@ -3,6 +3,13 @@ use strict;
use XML::Parser;
+sub wrap {
+ @_[0] =~ s/\\'/\\\\'/g;
+ @_[0] =~ s/\\q/\\\\q/g;
+ @_[0] =~ s/\\a/\\\\a/g;
+ @_[0] =~ s/\\n/\\\\n/g;
+}
+
sub load_wpo {
my ($tree, $tag ,$page) = @_;
@@ -11,12 +18,15 @@ sub load_wpo {
$page = load_wpo($leaf, $tag, $page);
} elsif (ref($leaf) eq 'HASH') {
# XML compatibility
- $leaf->{helpText} =~ s/\\'/\\\\'/g;
- $leaf->{helpText} =~ s/\\q/\\\\q/g;
- $leaf->{helpText} =~ s/\\a/\\\\a/g;
- $leaf->{helpText} =~ s/\\n/\\\\n/g;
+ wrap $leaf->{description};
+ wrap $leaf->{helpText};
+ wrap $leaf->{wizardTitle};
+ wrap $leaf->{nextButtonText};
+ $page->{$leaf->{wizardTitle}} = "";
$page->{$leaf->{helpText}} = "";
- }elsif(ref($leaf)=~ /\w\D/){
+ $page->{$leaf->{description}} = "";
+ $page->{$leaf->{nextButtonText}} = "";
+ } elsif(ref($leaf)=~ /\w\D/){
$tag = $leaf;
}
}
@@ -34,15 +44,8 @@ my $date = `date +%Y-%m-%d\\ %H:%M\\ %z`;
chomp $date;
foreach (keys %{$wpo}) {
- if ($_ ne "") {
- if ($_ eq $wpo->{$_}) {
- print PO "msgid \"$_\"\nmsgstr \"\"\n\n";
- }
- else {
- print PO "msgid \"$_\"\nmsgstr \"$wpo->{$_}\"\n\n";
- }
- }
-
+ print "$_\n";
+ $_ ne "" and print PO "msgid \"$_\"\nmsgstr \"\"\n\n";
}
close PO;
print STDERR "./po/$1.pot\n";