~ubuntu-branches/ubuntu/oneiric/xpad/oneiric

« back to all changes in this revision

Viewing changes to intltool-extract.in

  • Committer: Bazaar Package Importer
  • Author(s): Bart Martens
  • Date: 2007-12-10 22:52:37 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071210225237-llvwje5iwbbi5adw
Tags: 2.13-1
* New upstream release.
* debian/patches/01_workspaces.diff: Removed.
* debian/menu: Updated.

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.35.0";
 
35
my $VERSION      = "0.36.2";
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
231
237
 
232
238
    s/'/'/g; # '
233
239
    s/"/"/g; # "
234
 
    s/&/&/g;
235
240
    s/&lt;/</g;
236
241
    s/&gt;/>/g;
 
242
    s/&amp;/&/g;
237
243
 
238
244
    return $_;
239
245
}
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
 
711
720
    return @list;
712
721
}
713
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
 
714
734
sub type_glade {
715
735
    ### For translatable Glade XML files ###
716
736