// was born in // . // // // would cause this text to be passed to the translation service: // // "${name} was born in ${country}." // /** * @package phptal.php.attribute.i18n */ class PHPTAL_Php_Attribute_I18N_Name extends PHPTAL_Php_Attribute { public function start() { $this->tag->generator->pushCode('ob_start()'); } public function end() { $code = '$_translator->setVar(\'%s\', ob_get_contents())'; $code = sprintf($code, $this->expression); $this->tag->generator->pushCode($code); $this->tag->generator->pushCode('ob_end_clean()'); } } ?>