~ubuntu-branches/ubuntu/lucid/quick-lounge-applet/lucid

« back to all changes in this revision

Viewing changes to intltool-extract.in

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Rottmann
  • Date: 2004-12-16 13:06:08 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041216130608-i7tq2h21kzrdy4yl
Tags: 2.2.0-1
* New upstream release.
* Build-Depend on debhelper (>= 4.1.0), fixes linda error.

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.30";
 
35
my $VERSION      = "0.31.3";
36
36
 
37
37
## Loaded modules
38
38
use strict; 
266
266
sub type_xml {
267
267
    ### For generic translatable XML files ###
268
268
        
269
 
    while ($input =~ /\s_$w+\s*=\s*\"([^"]+)\"/sg) { # "
270
 
        $messages{entity_decode_minimal($1)} = [];
 
269
    while ($input =~ /(?:<!--([^>]*?)-->[^\n]*\n?[^\n]*)?\s_$w+\s*=\s*\"([^"]+)\"/sg) { # "
 
270
        $messages{entity_decode_minimal($2)} = [];
 
271
        $comments{entity_decode_minimal($2)} = $1 if (defined($1));
271
272
    }
272
273
 
273
 
    while ($input =~ /<_($w+)(?: xml:space="($w+)")?>(.+?)<\/_\1>/sg) {
274
 
        $_ = $3;
275
 
        if (!defined($2) || $2 ne "preserve") {
 
274
    while ($input =~ /(?:<!--([^>]*?)-->\s*)?<_($w+)(?: xml:space="($w+)")?[^>]*>(.+?)<\/_\2>/sg) {
 
275
        $_ = $4;
 
276
        if (!defined($3) || $3 ne "preserve") {
276
277
            s/\s+/ /g;
277
278
            s/^ //;
278
279
            s/ $//;
279
280
        }
280
 
        $messages{entity_decode_minimal($_)} = [];
 
281
        $messages{$_} = [];
 
282
        $comments{$_} = $1 if (defined($1));
281
283
    }
282
284
}
283
285
 
287
289
    # FIXME: We should handle escaped < (less than)
288
290
    while ($input =~ /
289
291
                      <locale\ name="C">\s*
290
 
                          (<default>\s*(.*?)\s*<\/default>\s*)?
291
 
                          (<short>\s*(.*?)\s*<\/short>\s*)?
292
 
                          (<long>\s*(.*?)\s*<\/long>\s*)?
 
292
                          (<default>\s*(?:<!--([^>]*?)-->\s*)?(.*?)\s*<\/default>\s*)?
 
293
                          (<short>\s*(?:<!--([^>]*?)-->\s*)?(.*?)\s*<\/short>\s*)?
 
294
                          (<long>\s*(?:<!--([^>]*?)-->\s*)?(.*?)\s*<\/long>\s*)?
293
295
                      <\/locale>
294
296
                     /sgx) {
295
 
        my @totranslate = ($2,$4,$6);
 
297
        my @totranslate = ($3,$6,$9);
 
298
        my @eachcomment = ($2,$5,$8);
296
299
        foreach (@totranslate) {
 
300
            my $currentcomment = shift @eachcomment;
297
301
            next if !$_;
298
 
        s/\s+/ /g;
299
 
        $messages{entity_decode_minimal($_)} = [];
 
302
            s/\s+/ /g;
 
303
            $messages{entity_decode_minimal($_)} = [];
 
304
            $comments{entity_decode_minimal($_)} = $currentcomment if (defined($currentcomment));
300
305
        }
301
306
    }
302
307
}