diff options
Diffstat (limited to 'tools/extract2gettext.php')
-rw-r--r-- | tools/extract2gettext.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/extract2gettext.php b/tools/extract2gettext.php index 0b1687540..424bb9172 100644 --- a/tools/extract2gettext.php +++ b/tools/extract2gettext.php @@ -54,8 +54,8 @@ $f = array(); $error = 0; if(count($out) == 0) { - echo "No strings to save from $php_source.\n"; - $error = 1; + if(!$quiet) { echo "No strings to save from $php_source.\n"; } + $error = 10; } foreach ($out as $str) { @@ -74,9 +74,10 @@ foreach ($out as $str) { } } else { - echo "\n\n!!!! Could not find string in $file, line $line: $str\n"; - echo "!!!! Please fix $file before using $domain.pot file!!!\n\n"; - $error = 2; + $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; } + $error = 20; } } @@ -121,13 +122,13 @@ foreach ($strings as $domain => $strs) { $dir = dirname($dest); if (!is_dir($dir)) { - echo "making $dir\n"; + if(!$quiet) { echo "making $dir\n"; } mkdir($dir, 0755, true); } - echo sprintf("saved %d strings in %s\n", count($strs), $dest); + if(!$quiet) { echo sprintf("saved %d strings in %s\n", count($strs), $dest); } if (FALSE === file_put_contents($dest, $f)) { - echo "Failed to write.\n"; - $error = 3; + if(!$quiet) { echo "Failed to write $f to $dest.\n"; } + $error = 30; } } if(!$quiet) { echo "Done. thxbye.\n"; } |