aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/extract2gettext.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/extract2gettext.php b/tools/extract2gettext.php
index ba2c927e9..73e873333 100644
--- a/tools/extract2gettext.php
+++ b/tools/extract2gettext.php
@@ -45,7 +45,7 @@ date_default_timezone_set(@date_default_timezone_get());
if(!$quiet) { echo "ohay!\n";}
-$cmd = sprintf('grep -HrnEi "_(g|r)\((.*)" %s', $php_source);
+$cmd = sprintf('grep -HrnEi "_(g|r|t)\([^$](.*)" %s', $php_source);
if(!$quiet) { echo $cmd, "\n"; }
exec($cmd, $out);
@@ -67,13 +67,12 @@ foreach ($out as $str) {
$arr = implode(':', $arr);
$arr = str_replace('\\\'', '_apostrophe_', $arr);
- if (preg_match_all('/\_(g|r)\(\'(.+)\'/imU', $arr, $reg)) { // i=PCRE_CASELESS, m=PCRE_MULTILINE, U=PCRE_UNGREEDY
+ if (preg_match_all('/\_(g|r|t)\(\'(.+)\'/imU', $arr, $reg)) { // i=PCRE_CASELESS, m=PCRE_MULTILINE, U=PCRE_UNGREEDY
foreach ($reg[2] as $found) {
$found = str_replace('_apostrophe_', '\'', $found);
$strings[$domain][$found][] = '/web/' . $file . ' +' . $line;
}
- }
- else {
+ } else {
$parse_error = "\n\n!!!! Could not find string in $file, line $line: $str\n";
$parse_error .= "!!!! Parse error, please fix $file before using $domain.pot file!!!\n\n";
if(!$quiet) { echo $parse_error; }