diff --git a/util/README b/util/README index 725bef4525..0f0a169b39 100644 --- a/util/README +++ b/util/README @@ -8,7 +8,7 @@ cmdline and see if any parsing errors are reported. Internationalisation -extract.php - extracts translatable strings from our project files. It +php bin/console extract - extracts translatable strings from our project files. It currently doesn't pick up strings in other libraries we might be using such as the HTML parsers. @@ -61,7 +61,7 @@ e.g. Plural -The L10n::tt() function supports plural form. Script extract.php write this in +The L10n::tt() function supports plural form. The extract command writes this in strings.php as an array, one string for every plural form language supports: $a->string["%d message sent"] = Array( diff --git a/util/extract.php b/util/extract.php deleted file mode 100755 index 18fbb9df00..0000000000 --- a/util/extract.php +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env php -strings[' . $match . '] = ' . $match . ';' . "\n"; - } - } - } - if (count($matchestt)) { - foreach ($matchestt[1] as $match) { - $matchtkns = preg_split("|[ \t\r\n]*,[ \t\r\n]*|", $match); - if (count($matchtkns) == 3 && !in_array($matchtkns[0], $arr)) { - if (substr($matchtkns[1], 0, 1) == '$') { - continue; - } - - $arr[] = $matchtkns[0]; - - $s .= '$a->strings[' . $matchtkns[0] . "] = array(\n"; - $s .= "\t0 => " . $matchtkns[0] . ",\n"; - $s .= "\t1 => " . $matchtkns[1] . ",\n"; - $s .= ");\n"; - } - } - } -} - -$s .= '// Timezones' . PHP_EOL; - -$zones = timezone_identifiers_list(); -foreach ($zones as $zone) { - $s .= '$a->strings[\'' . $zone . '\'] = \'' . $zone . '\';' . "\n"; -} - -echo $s; - -function glob_recursive($path) { - $dir_iterator = new RecursiveDirectoryIterator($path); - $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); - - $return = []; - foreach ($iterator as $file) { - if ($file->getBasename() != '.' && $file->getBasename() != '..') { - $return[] = $file->getPathname(); - } - } - - return $return; -}