* @license PHP License
* @package wb
* @subpackage Markup
*/
WBClass::load('WBMarkup_Handler_I18nExtractor');
/**
* Markup Handler: I18nExtractor_HtmlTemplate
*
*
* @version 0.1.0
* @package wb
* @subpackage Markup
*/
class WBMarkup_Handler_I18nExtractor_HtmlTemplate extends WBMarkup_Handler_I18nExtractor
{
/**
* extract translatable strings from node
*
* Do the magic thing
*
* @param array $node
*/
protected function extract($node)
{
if ('pattemplate' != strtolower($node['ns'])) {
return;
}
if ('gettext' != strtolower($node['tag'])) {
return;
}
$cData = implode($node['cData']);
$domain = null;
if (isset($node['attributes']['domain'])) {
$domain = $node['attributes']['domain'];
}
if (isset($node['attributes']['bracemode']) && 'tex' == $node['attributes']['bracemode']) {
$in = array('<{', '}>');
$out = array('{', '}');
$cData = str_replace($in, $out, $cData);
}
$this->imp->addMsg($cData, null, $domain);
}
}