X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Flocales.pl;h=9e6a4ae58ecfd6ec4fe91654a9853c2a1f6f79f4;hb=cb3431bcc4eae2bc5a2851cae10f9dfd8f517c4a;hp=d8df86296e7da21ab518dfd641e35be351576176;hpb=7635f647ec7dcdef51684b21601ee0930ea2bc5b;p=kivitendo-erp.git diff --git a/scripts/locales.pl b/scripts/locales.pl index d8df86296..9e6a4ae58 100755 --- a/scripts/locales.pl +++ b/scripts/locales.pl @@ -43,6 +43,10 @@ our $self = {}; our $missing = {}; our @lost = (); +my %ignore_unused_templates = ( + map { $_ => 1 } qw(common/help_overlay.html ct/testpage.html generic/autocomplete.html oe/periodic_invoices_email.txt part/testpage.html t/render.html t/render.js) +); + my (%referenced_html_files, %locale, %htmllocale, %alllocales, %cached, %submit, %jslocale); my ($ALL_HEADER, $MISSING_HEADER, $LOST_HEADER); @@ -440,8 +444,11 @@ sub scanfile { } } - my ($found) = / (?: locale->text | \b t8 ) \b .*? \(/x; - $postmatch = "$'"; + my $found; + if (/ (?: locale->text | \b t8 ) \b .*? \(/x) { + $found = 1; + $postmatch = "$'"; + } if ($found) { my $string; @@ -655,7 +662,7 @@ sub search_unused_htmlfiles { if (-d $entry) { push @unscanned_dirs, $entry; - } elsif (($entry =~ /_master.html$/) && -f $entry && !$referenced_html_files{$entry}) { + } elsif (!$ignore_unused_templates{strip_base($entry)} && -f $entry && !$referenced_html_files{$entry}) { print "W: unused HTML template: " . strip_base($entry) . "\n"; }