From 6f2fc71ffadb049855b2ff2c9fc0a1952b736484 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 20 Aug 2013 17:10:56 +0000 Subject: remove obsolete/useless scripts git-svn-id: http://piwigo.org/svn/trunk@24201 68402e56-0260-453c-a942-63ccdbb3a9ee --- tools/convert_template_to_2.1.pl | 48 ---------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 tools/convert_template_to_2.1.pl (limited to 'tools/convert_template_to_2.1.pl') diff --git a/tools/convert_template_to_2.1.pl b/tools/convert_template_to_2.1.pl deleted file mode 100644 index a838e8f8b..000000000 --- a/tools/convert_template_to_2.1.pl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl - -# perl tools/convert_template_to_2.1.pl /path/to/tpl/files/directory - -use strict; -use warnings; - -use File::Find; - -my $base_dir = $ARGV[0]; - -# load the replacements -my @file_codes = qw/upgrade install admin common/; -my %replace_by = (); -foreach my $file_code (@file_codes) { - open(my $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(); - -find(\&replace_keys, $base_dir); - -sub replace_keys { - if ($File::Find::name !~ m/tpl$/) { - return 0; - } - - my $file_content = ''; - open(my $fhi, '<', $File::Find::name); - while (<$fhi>) { - foreach my $from (keys %replace_by) { - my $to = $replace_by{$from}; - s/{'$from'\|\@translate/{'$to'|\@translate/g; - } - $file_content.= $_; - } - close($fhi); - - open(my $fho, '>', $File::Find::name); - print {$fho} $file_content; - close($fho); -} -- cgit v1.2.3