From e16866e072f94410321d70daedbcb855ea878cac Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 6 Nov 2011 15:56:40 -0600 Subject: Actually move the kde files that were renamed in the last commit --- tdeui/preparetips | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 tdeui/preparetips (limited to 'tdeui/preparetips') diff --git a/tdeui/preparetips b/tdeui/preparetips new file mode 100755 index 000000000..baeaaf3b4 --- /dev/null +++ b/tdeui/preparetips @@ -0,0 +1,66 @@ +#! /usr/bin/perl +# 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 + +# IMPORTANT NOTE: Do not change the output without checking if +# translations still work! + +sub printText +{ + my $text = $_[0]; + + if ( $text cmp "" ) + { + + # replace \ with \\ + $text =~ s/\\/\\\\/g; + + # replace " with \" + $text =~ s/"/\\"/g; + + print "\"$text\\n\"\n"; + } +} + +open(FILE,"<","tips") or die "unable to open tips file"; +if ( $^V ge v5.8.0 ) +{ + binmode(FILE,":utf8"); + binmode(STDOUT,":utf8"); +} + +$inTip=0; + +while() +{ + chomp; + + # tip starts with + if(/^\s*(.*)/io) + { + $inTip=1; + print "//i18n file tips.cpp line $.\n"; + print "i18n(\n"; + printText($1); + next; + } + + if($inTip!=0) + { + # tip ends with + if(/^(.*)\s*<\/html>/io) + { + printText($1); + print ");\n\n"; + $inTip=0; + } + else + { + printText($_); + } + } +} + +close(FILE); -- cgit v1.2.3