From feb0d27a510c4d70885624715e6f906dcb1725f7 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 23 Mar 2010 21:50:48 +0000 Subject: improvement: piwigo_dir can be set from the command line bug fixed: changing filters for files to check. git-svn-id: http://piwigo.org/svn/trunk@5296 68402e56-0260-453c-a942-63ccdbb3a9ee --- tools/missing_keys.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tools/missing_keys.pl') diff --git a/tools/missing_keys.pl b/tools/missing_keys.pl index 4105407f1..358525675 100644 --- a/tools/missing_keys.pl +++ b/tools/missing_keys.pl @@ -8,8 +8,8 @@ use File::Find; our %used_keys = (); our %registered_keys = (); -my $piwigo_dir = '/home/pierrick/public_html/piwigo/dev/trunk'; -my $type = $ARGV[0]; # common, admin, install, upgrade +my $piwigo_dir = $ARGV[0]; # '/home/pierrick/public_html/piwigo/dev/trunk'; +my $type = $ARGV[1]; # common, admin, install, upgrade find(\&used_keys, $piwigo_dir); load_registered_keys($type); @@ -18,8 +18,8 @@ foreach my $key (sort keys %used_keys) { # print "{".$key."}", ' is used', "\n"; if (not defined $registered_keys{$key}) { - print "{".$key."}", ' is missing', "\n"; - # print '$lang[\''.$key.'\'] = \''.$key.'\';', "\n"; + # print "{".$key."}", ' is missing', "\n"; + print '$lang[\''.$key.'\'] = \''.$key.'\';', "\n"; } } @@ -34,7 +34,7 @@ sub used_keys { return 0; } - if ($File::Find::name =~ m{/(plugins|language)/}) { + if ($File::Find::name =~ m{/(plugins|language|_data)/}) { return 0; } @@ -69,6 +69,9 @@ sub used_keys { if ($File::Find::name =~ m{/admin/}) { $is_admin = 1; } + if ($File::Find::name =~ m{/admin\.php$}) { + $is_admin = 1; + } if (not $is_admin) { return 0; @@ -82,7 +85,7 @@ sub used_keys { if ($File::Find::name =~ m{/install(\.tpl|\.php|/)}) { return 0; } - if ($File::Find::name =~ m{/admin/} or $File::Find::name =~ m{themes/default/template/mail}) { + if ($File::Find::name =~ m{/admin(/|\.php)} or $File::Find::name =~ m{themes/default/template/mail}) { return 0; } } -- cgit v1.2.3