* @license PHP License * @package wb * @subpackage Markup */ WBClass::load('WBMarkup_Handler_I18nExtractor'); /** * Markup Handler: I18nExtractor_HtmlTemplate * * @version 0.2.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); } if (empty($cData)) { return; } $this->imp->addMsg($cData, null, $domain); } }