aboutsummaryrefslogtreecommitdiffstats
path: root/tools/replace.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2013-08-20 17:10:56 +0000
committerplegall <plg@piwigo.org>2013-08-20 17:10:56 +0000
commit6f2fc71ffadb049855b2ff2c9fc0a1952b736484 (patch)
treedd40e49beddde1c22be2a939b8aa7f71e9d8317a /tools/replace.php
parent6b73cb58b78a9b23d71f9843ee3fa176058a521e (diff)
remove obsolete/useless scripts
git-svn-id: http://piwigo.org/svn/trunk@24201 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'tools/replace.php')
-rwxr-xr-xtools/replace.php53
1 files changed, 0 insertions, 53 deletions
diff --git a/tools/replace.php b/tools/replace.php
deleted file mode 100755
index 0596ca064..000000000
--- a/tools/replace.php
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/php -qn
-<?php
-if (isset($_SERVER['argc']) && $_SERVER['argc']<=1)
-{
- echo "\n";
- echo 'usage : ', basename($_SERVER['argv'][0]), " <filename>\n";
- echo "\n";
- exit(1);
-}
-
-$filename = trim($_SERVER['argv'][1]);
-$lines = file($filename);
-$content = file_get_contents($filename);
-
-$n = 0;
-$nbLines = count($lines);
-
-$pattern = "`(.*{')(.*)('\|@translate}.*)`Um";
-$replace = "'{\''.keyReplace('\\1').'\'|@translate}'";
-
-include "language/templates/common.lang.php";
-include "language/templates/admin.lang.php";
-include "language/templates/upgrade.lang.php";
-include "language/templates/install.lang.php";
-
-while ($n < $nbLines) {
- preg_match_all($pattern, $lines[$n], $matches);
- echo str_replace($matches[2], keyReplace($matches[2]), $lines[$n]);
- $n++;
-}
-
-function keyReplace($key) {
- global $lang;
-
- if (is_array($key)) {
- $translation = array();
- foreach ($key as $i => $k) {
- if (isset($lang[$k])) {
- $translation = addslashes($lang[$k]);
- } else {
- $translation = "$k";
- }
- }
- } else {
- if (isset($lang[$key])) {
- $translation = addslashes($lang[$key]);
- } else {
- $translation = "$key";
- }
- }
- return $translation;
-}
-?> \ No newline at end of file