From 11f8fea2e6d209ae6a6467bd8b242f1d8d584da2 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 17 Aug 2006 05:41:31 +0000 Subject: [PATCH] Adding makepo.sh.php which is currently under heavy development --- docs/makepo.sh.php | 84 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 docs/makepo.sh.php diff --git a/docs/makepo.sh.php b/docs/makepo.sh.php new file mode 100755 index 0000000..47fcc95 --- /dev/null +++ b/docs/makepo.sh.php @@ -0,0 +1,84 @@ +#!/usr/bin/php + $nodes) +{ + $dirpath = ($dirpath ? BSFunctions::FetchSourcePath($dirpath) : ''); + foreach ($nodes AS $file) + { + $ext = BSFunctions::FetchExtension($file); + if ($ext == 'php') + { + $files[] = '.' . BSFunctions::FetchSourcePath($search) . $dirpath . $file; + } + else if ($ext == 'xml' OR $ext == 'tpl' OR $ext == 'html' OR $ext == 'htm') + { + $templates[] = array( + 'orig' => '.' . BSFunctions::FetchSourcePath($search) . $dirpath . $file, + 'temp' => '.' . BSFunctions::FetchSourcePath($search) . $dirpath . 'xgtxt-' . $file . '.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']); + + if (strpos($template, '{@') === false) + { + continue; + } + + $template = str_replace('"', '\"', $template); + + $template = preg_replace('#\{@\\\"(.*?)\\\"\}#ise', 'process_template_text(\'$1\')', $template); + + print($template); exit; + + file_put_contents($paths['temp'], preg_replace('#\{@"(.*)"\}#e', "process_template_text('\1')", $template)); +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file -- 2.22.5