Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2d6a42ee

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

Locales.pl: bei Templatefiles auch nach .json und .js suchen

Unterschiede anzeigen:

scripts/locales.pl
360 360

  
361 361
      # is this a template call?
362 362
      if (/(?:parse_html_template2?|render)\s*\(\s*[\"\']([\w\/]+)\s*[\"\']/) {
363
        my $newfile = "$basedir/templates/webpages/$1.html";
363
        my $new_file_base = "$basedir/templates/webpages/$1.";
364 364
        if (/parse_html_template2/) {
365
          print "E: " . strip_base($file) . " is still using 'parse_html_template2' for " . strip_base($newfile) . ".\n";
365
          print "E: " . strip_base($file) . " is still using 'parse_html_template2' for " . strip_base("${new_file_base}html") . ".\n";
366 366
        }
367
        if (-f $newfile) {
368
           $cached{$file}{scanh}{$newfile} = 1;
369
          print "." if $opt_v;
370
        } elsif ($opt_c) {
371
          print "W: missing HTML template: " . strip_base($newfile) . " (referenced from " . strip_base($file) . ")\n";
367

  
368
        my $found_one = 0;
369
        foreach my $ext (qw(html js json)) {
370
          my $new_file = "${new_file_base}${ext}";
371
          if (-f $new_file) {
372
            $cached{$file}{scanh}{$new_file} = 1;
373
            print "." if $opt_v;
374
            $found_one = 1;
375
          }
376
        }
377

  
378
        if ($opt_c && !$found_one) {
379
          print "W: missing HTML template: " . strip_base($new_file_base) . "{html,json,js} (referenced from " . strip_base($file) . ")\n";
372 380
        }
373 381
      }
374 382

  

Auch abrufbar als: Unified diff