From 325c9529e71a5af1c2cd5299e904d4b6e729c1f7 Mon Sep 17 00:00:00 2001 From: Filip Komar Date: Mon, 31 Mar 2014 16:39:41 +0000 Subject: tools prepared for conversion of mognase to gettext debuged ;) --- tools/extract2gettext.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tools/extract2gettext.php') 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; } -- cgit v1.2.1