aboutsummaryrefslogtreecommitdiffstats
path: root/tools/missing_keys.pl
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-03-23 21:50:48 +0000
committerplegall <plg@piwigo.org>2010-03-23 21:50:48 +0000
commitfeb0d27a510c4d70885624715e6f906dcb1725f7 (patch)
tree9eac67cebaaec1d7660e4a504e845f4a392c16fb /tools/missing_keys.pl
parented6518319b2c5a6c7913b633a52f004663fe3242 (diff)
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
Diffstat (limited to '')
-rw-r--r--tools/missing_keys.pl15
1 files changed, 9 insertions, 6 deletions
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;
}
}