diff options
author | plegall <plg@piwigo.org> | 2013-08-20 17:10:56 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2013-08-20 17:10:56 +0000 |
commit | 6f2fc71ffadb049855b2ff2c9fc0a1952b736484 (patch) | |
tree | dd40e49beddde1c22be2a939b8aa7f71e9d8317a /tools/replace_language_keys.pl | |
parent | 6b73cb58b78a9b23d71f9843ee3fa176058a521e (diff) |
remove obsolete/useless scripts
git-svn-id: http://piwigo.org/svn/trunk@24201 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'tools/replace_language_keys.pl')
-rw-r--r-- | tools/replace_language_keys.pl | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/tools/replace_language_keys.pl b/tools/replace_language_keys.pl deleted file mode 100644 index 822b3e1cc..000000000 --- a/tools/replace_language_keys.pl +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -my $replacement_file = $ARGV[0]; -my $language_dir = $ARGV[1]; - -# load the replacements -my %replace_by = (); -open(my $ifh_rep, '<'.$replacement_file); -while (<$ifh_rep>) { - if (m/^\$lang\['(.*)'\] \s* = \s* (['"])(.*)\2;/x) { - if ($1 ne $3 and length($1) > 0) { - $replace_by{$1} = $3; - } - } -} -# use Data::Dumper; print Dumper(\%replace_by); exit(); - -my $append_to_common = ''; - -foreach my $file_code (qw/upgrade install admin common plugin/) { - my $filename = $language_dir.'/'.$file_code.'.lang.php'; - # print $filename; - if (not -f $filename) { - # print ' is missing', "\n"; - next; - } - print $filename.' is under process', "\n"; - - my $file_content = ''; - - open(my $ifh, '<'.$filename); - while (my $line = <$ifh>) { - if ($line =~ m/^\$lang\['(.*)'\] \s* =/x) { - if (defined $replace_by{$1}) { - my $search = quotemeta($1); - my $replace = $replace_by{$1}; - - $line =~ s{$search}{$replace}; - $file_content.= $line; - } - else { - $file_content.= $line; - } - } - elsif ($line =~ m/^?>/) { - $file_content.= $line; - } - else { - $file_content.= $line; - } - } - close($ifh); - - open(my $ofh, '>'.$filename); - print {$ofh} $file_content; - close($ofh); -} |