On 03-10-2008 at 21:56:04 a b <[EMAIL PROTECTED]> wrote:

How to modify default namespace
to have shorter notatnion of:
<tal:block i18n:translate="">my string</tal:block>
(assuming I do not use i18n:translate="var")

for example as:
<tal:lang>my string</tal:lang>

There's nothing within TAL syntax that can do it. You could extend PHPTAL to create <tal:lang> tag, but the easiest solution might be to write a prefilter:

class EzI18n extends PHPTAL_Filter
{
  function filter($src)
  {
return preg_replace('!<my:lang>(.*?)</my:lang>!s','<tal:block i18n:translate="">\1</tal:block>',$src);
  }
}

$phptal->setPreFilter(new EzI18n());

(regular expressions used for XML aren't very elegant - you could use DOM+XSLT instead)

--
regards, Kornel

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to