aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lookup_for_second_argument.php
diff options
context:
space:
mode:
authorMarek Laane <bald@smail.ee>2014-10-12 10:54:11 +0300
committerMarek Laane <bald@smail.ee>2014-10-12 10:54:11 +0300
commita0b2d09125d7911656fe4cb286f20643c4432281 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /tools/lookup_for_second_argument.php
parente32d8242187534c387106ff344201c42ff6afb44 (diff)
downloadwww-a0b2d09125d7911656fe4cb286f20643c4432281.tar
www-a0b2d09125d7911656fe4cb286f20643c4432281.tar.gz
www-a0b2d09125d7911656fe4cb286f20643c4432281.tar.bz2
www-a0b2d09125d7911656fe4cb286f20643c4432281.tar.xz
www-a0b2d09125d7911656fe4cb286f20643c4432281.zip
Updated Estonian translation
Diffstat (limited to 'tools/lookup_for_second_argument.php')
-rw-r--r--tools/lookup_for_second_argument.php61
1 files changed, 0 insertions, 61 deletions
diff --git a/tools/lookup_for_second_argument.php b/tools/lookup_for_second_argument.php
deleted file mode 100644
index 97ce33728..000000000
--- a/tools/lookup_for_second_argument.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
- * Lookup for second argument in functions _t() and _d() in source code
- *
- * PHP 5.3
- *
- * @license MIT
- * @author Filip (transformation to build a gettext dictionary)
- * @copyright 2014/02
- * based on extract2lang.php by author Romain d'Alverny, rdalverny, rda
-*/
-
-if (php_sapi_name() !== 'cli') {
- echo "CLI only.\n";
- exit(1);
-}
-
-if (version_compare(PHP_VERSION, '5.3.0') < 0) {
- echo "PHP 5.3 needed.\n";
- exit(1);
-}
-
-$php_source = isset($argv[1]) ? $argv[1] : null;
-$domain = isset($argv[2]) ? $argv[2] : null;
-
-if (is_null($php_source) || is_null($domain)) {
- echo <<<U
-Usage:
- php tools/lookup_for_second_argument.php path/to/source.php domain_name
-
- Example:
- php tools/lookup_for_second_argument.php en/index.php index
-
- You can join multiple sources with apostrophe - single quote (') like this:
- 'en/3/download_index.php en/for-pc/index.php en/for-server/index.php en/3/index.php en/3/nav.php'
-
-U;
- exit(1);
-}
-
-date_default_timezone_set(@date_default_timezone_get());
-
-$cmd = sprintf('grep -HrnEi "_(e|t|h|d)\((.*)" %s', $php_source);
-exec($cmd, $out);
-
-foreach ($out as $str) {
- $arr = explode(':', $str);
- $file = array_shift($arr);
- $line = array_shift($arr);
- $arr = implode(':', $arr);
- $arr = str_replace('\\\'', '_apostrophe_', $arr);
- if (preg_match_all('/\_(t|d)\(\'(.+)\'(,.+)$/im', $arr, $test)) { // qq i=PCRE_CASELESS, m=PCRE_MULTILINE, U=PCRE_UNGREEDY
- foreach ($test[3] as $more_arg) { // qq
- $att = $php_source . ' (line ' . $line . '): '. trim($arr) . PHP_EOL; // qq
- $attention[] = $att;
- echo $att . PHP_EOL;
- }
- }
-}
-
-exit(0);