diff options
Diffstat (limited to 'amor/preparetips')
-rw-r--r-- | amor/preparetips | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/amor/preparetips b/amor/preparetips new file mode 100644 index 0000000..03bcf67 --- /dev/null +++ b/amor/preparetips @@ -0,0 +1,45 @@ +# little script to extract the text from the tips file +# and output it, so xgettext can add the tips to the po file +# +# 2000 by Matthias Kiefer <[email protected]> + +open(FILE,"<data/tips-en") || die "unable to open tips file"; + +$inTip=0; +$tip=""; + +while(<FILE>) +{ + chomp; + + # tip ends with % + if(!/^%/) + { + # replace \ with \\ + s/\\/\\\\/g; + + # replace " with \" + s/"/\\"/g; + + if($inTip != 0) + { + $tip=$tip."\n\"$_\\n\""; + } + else + { + $inTip=1; + $tip="\"$_\\n\""; + } + + next; + } + elsif($inTip != 0) + { + # remove last newline + $tip =~ s/\\n\"$/\"/g; + print "i18n(\n", $tip, "\n);\n"; + $inTip=0; + } +} + +close(FILE); |