~ubuntu-branches/ubuntu/gutsy/serpentine/gutsy

« back to all changes in this revision

Viewing changes to intltool-extract.in

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-08-16 21:15:55 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070816211555-t0h0nugk2kn1tb61
Tags: 0.9-0ubuntu1
* New upstream version
* debian/control:
  - updated XS-Python-Version value

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
## Release information
33
33
my $PROGRAM      = "intltool-extract";
34
34
my $PACKAGE      = "intltool";
35
 
my $VERSION      = "0.34.1";
 
35
my $VERSION      = "0.35.5";
36
36
 
37
37
## Loaded modules
38
38
use strict; 
114
114
sub place_normal {
115
115
    $FILE        = $ARGV[0];
116
116
    $OUTFILE     = "$FILE.h";
 
117
 
 
118
    my $dirname = dirname ($OUTFILE);
 
119
    if (! -d "$dirname" && $dirname ne "") {
 
120
        system ("mkdir -p $dirname");
 
121
    }
117
122
}   
118
123
 
119
124
sub place_local {
156
161
      --type=TYPE   Specify the file type of FILENAME. Currently supports:
157
162
                    "gettext/glade", "gettext/ini", "gettext/keys"
158
163
                    "gettext/rfc822deb", "gettext/schemas",
159
 
                    "gettext/scheme", "gettext/xml"
 
164
                    "gettext/scheme", "gettext/xml", "gettext/quoted"
160
165
  -l, --local       Writes output into current working directory
161
166
                    (conflicts with --update)
162
167
      --update      Writes output into the same directory the source file 
212
217
    &type_scheme if $gettext_type eq "scheme";
213
218
    &type_schemas  if $gettext_type eq "schemas";
214
219
    &type_rfc822deb  if $gettext_type eq "rfc822deb";
 
220
    &type_quoted if $gettext_type eq "quoted";
215
221
}
216
222
 
217
223
sub entity_decode_minimal
242
248
{
243
249
    return '\"' if $_ eq '"';
244
250
    return '\n' if $_ eq "\n";
245
 
    return '\\' if $_ eq '\\';
 
251
    return '\\\\' if $_ eq '\\';
246
252
 
247
253
    return $_;
248
254
}
255
261
 
256
262
sub type_ini {
257
263
    ### For generic translatable desktop files ###
258
 
    while ($input =~ /^_.*=(.*)$/mg) {
259
 
        $messages{$1} = [];
 
264
    while ($input =~ /^(#(.+)\n)?^_.*=(.*)$/mg) {
 
265
        if (defined($2))  {
 
266
            $comments{$3} = $2;
 
267
        }
 
268
        $messages{$3} = [];
260
269
    }
261
270
}
262
271
 
485
494
sub intltool_tree_comment
486
495
{
487
496
    my $expat = shift;
488
 
    my $data  = shift;
 
497
    my $data  = $expat->original_string();
489
498
    my $clist = $expat->{Curlist};
490
499
    my $pos   = $#$clist;
491
500
 
 
501
    $data =~ s/^<!--//s;
 
502
    $data =~ s/-->$//s;
492
503
    push @$clist, 1 => $data;
493
504
}
494
505
 
709
720
    return @list;
710
721
}
711
722
 
 
723
sub type_quoted {
 
724
    while ($input =~ /\"(([^\"]|\\\")*[^\\\"])\"/g) {
 
725
        my $message = $1;
 
726
        my $before = $`;
 
727
        $message =~ s/\\\"/\"/g;
 
728
        $before =~ s/[^\n]//g;
 
729
        $messages{$message} = [];
 
730
        $loc{$message} = length ($before) + 2;
 
731
    }
 
732
}
 
733
 
712
734
sub type_glade {
713
735
    ### For translatable Glade XML files ###
714
736