aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFilip Komar <filip@mageia.org>2014-03-31 16:39:41 +0000
committerFilip Komar <filip@mageia.org>2014-03-31 16:39:41 +0000
commit325c9529e71a5af1c2cd5299e904d4b6e729c1f7 (patch)
treed32e70df5ce3e5bc104c7b2a1a650cac47df13f4 /tools
parent3f8520d07e33b464f0b7555fd18387bd2d29ca4f (diff)
downloadwww-325c9529e71a5af1c2cd5299e904d4b6e729c1f7.tar
www-325c9529e71a5af1c2cd5299e904d4b6e729c1f7.tar.gz
www-325c9529e71a5af1c2cd5299e904d4b6e729c1f7.tar.bz2
www-325c9529e71a5af1c2cd5299e904d4b6e729c1f7.tar.xz
www-325c9529e71a5af1c2cd5299e904d4b6e729c1f7.zip
tools prepared for conversion of mognase to gettext debuged ;)
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; }