#!/usr/bin/php BSFunctions::fetch_source_path('./' . $dirpath) . $file, 'temp' => BSFunctions::fetch_source_path('./' . $dirpath) . $file . '.xgt.php' ); } } // ################################################################### // compile the templates into gettext-friendly PHP code function process_template_text($text) { return ''; } foreach ($templates as $paths) { $template = file_get_contents($paths['orig']); $template = preg_replace('#\{@\\"(.*?)\\"\}#ise', 'process_template_text(\'$1\')', $template); file_put_contents($paths['temp'], $template); $removelater[] = $paths['temp']; } // ################################################################### // run xgettext on all of the various files that we have now created // get any arguments and just pass them to xgettext $arguments = $argv; unset($arguments[0]); exec('xgettext ' . implode(' ', $arguments) . ' ' . implode(' ', $files)); // ################################################################### // remove all the files we no longer need foreach ($removelater as $path) { unlink($path); } ?>