summaryrefslogtreecommitdiffstats
path: root/pot/preparetips
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-10 05:14:00 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-10 05:14:00 +0000
commitfa949b6b7fa553547f26305d4227e8baa0091c1f (patch)
tree9199255f7d3e0f276f6f53000f13fb0081f3c4c5 /pot/preparetips
downloadbibletime-fa949b6b7fa553547f26305d4227e8baa0091c1f.tar.gz
bibletime-fa949b6b7fa553547f26305d4227e8baa0091c1f.zip
Added initial Trinity version of BibleTime
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/bibletime@1173688 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'pot/preparetips')
-rwxr-xr-xpot/preparetips45
1 files changed, 45 insertions, 0 deletions
diff --git a/pot/preparetips b/pot/preparetips
new file mode 100755
index 0000000..1e5c35a
--- /dev/null
+++ b/pot/preparetips
@@ -0,0 +1,45 @@
+# !/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 <[email protected]>
+# Command line option added by Joachim Ansorg
+
+open(FILE,"<$ARGV[0]") || die "unable to open tips file";
+
+$inTip=0;
+
+while(<FILE>)
+{
+ chomp;
+
+ # tip starts with <html>
+ if(/^\s*<html>/i)
+ {
+ $inTip=1;
+ print "\ni18n(\n";
+ next;
+ }
+
+ if($inTip!=0)
+ {
+ # tip ends with </html>
+ if(/^\s*<\/html>/i)
+ {
+ print ");\n";
+ $inTip=0;
+ }
+ else
+ {
+ # replace \ with \\
+ s/\\/\\\\/g;
+
+ # replace " with \"
+ s/"/\\"/g;
+
+ print "\"$_\\n\"\n";
+ }
+ }
+}
+
+close(FILE);