You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdetoys/amor/preparetips

46 lines
641 B

# 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 <matthias.kiefer@gmx.de>
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);