~ubuntu-branches/ubuntu/intrepid/bibletime/intrepid

« back to all changes in this revision

Viewing changes to pot/preparetips

  • Committer: Bazaar Package Importer
  • Author(s): Ralph Janke
  • Date: 2008-05-10 15:18:16 UTC
  • mfrom: (1.1.6 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080510151816-bqp8y1to705zd0fm
Tags: 1.6.5.1-1
* New upstream version (Closes: #441161, #271502)
* fixes for new autotools and gcc 4.3 (Closes: #407291)
* added poxml to Build-Depends
* No DFSG necessary anymore since biblestudy howto has 
  now Commons Licence 
* Added libclucene-dev to dev-depends (Closes: #436677)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# !/usr/bin/perl
 
2
# little script to extract the text from the tips file
 
3
# and output it, so xgettext can add the tips to the po file
 
4
#
 
5
# 2000 by Matthias Kiefer <matthias.kiefer@gmx.de>
 
6
# Command line option added by Joachim Ansorg
 
7
 
 
8
open(FILE,"<$ARGV[0]") || die "unable to open tips file";
 
9
 
 
10
$inTip=0;
 
11
 
 
12
while(<FILE>)
 
13
{
 
14
        chomp;
 
15
 
 
16
        # tip starts with <html>
 
17
        if(/^\s*<html>/i)
 
18
        {
 
19
                $inTip=1;
 
20
                print "\ni18n(\n";
 
21
                next;
 
22
        }       
 
23
 
 
24
        if($inTip!=0)
 
25
        {
 
26
                # tip ends with </html>
 
27
                if(/^\s*<\/html>/i)
 
28
                {
 
29
                        print ");\n";
 
30
                        $inTip=0;
 
31
                }
 
32
                else
 
33
                {
 
34
                        # replace \ with \\
 
35
                        s/\\/\\\\/g;
 
36
 
 
37
                        # replace " with \"
 
38
                        s/"/\\"/g;
 
39
                        
 
40
                        print "\"$_\\n\"\n";
 
41
                }
 
42
        }   
 
43
}
 
44
 
 
45
close(FILE);