summaryrefslogtreecommitdiffstats
path: root/amor/preparetips
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitae2a03c2941bf92573f89b88ef73f8aa842bea0a (patch)
tree3566563f3fb6ac3cb3496669d8f233062d3091bc /amor/preparetips
downloadtdetoys-ae2a03c2941bf92573f89b88ef73f8aa842bea0a.tar.gz
tdetoys-ae2a03c2941bf92573f89b88ef73f8aa842bea0a.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdetoys@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'amor/preparetips')
-rw-r--r--amor/preparetips45
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 <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);