http://www.perlmonks.org?node_id=466327


in reply to Re^2: Template::Toolkit, look-and-feel and internationalization
in thread Template::Toolkit, look-and-feel and internationalization

It's built to handle things like [% FILTER repeat(3) %]blah [% END %] -- Two starting points (with some good examples) are the FILTER directive and the Template::Filters docs.

Replies are listed 'Best First'.
Re^4: Template::Toolkit, look-and-feel and internationalization
by ruoso (Curate) on Jun 14, 2005 at 11:54 UTC
    Just a little question... I saw that the | can be used for an alias to FILTER, but I didn't understood if this only applies to non-block directive... And if it's valid to remove the whitespaces... would the following be valid?
    • [%|i18n%]Text to be translated[%END%]
    • [%|i18n(10)%]You gained %d experience points[%END%]

    P.S.: Is there an alias for [%END%]?

    daniel
      <EDIT>
      Yes, that's valid
      </EDIT>

      Changing that to:
      [% "Text to be translated" | i18n %]
      and
      [% "You gained %d experience points" | i18n(10) %]

      respectively, would eliminate the need for the [%END%] tag. I also find this more readable.
Re^4: Template::Toolkit, look-and-feel and internationalization
by lachoy (Parson) on Jun 14, 2005 at 01:23 UTC

    Nice! Learn something new every day...

    Chris
    M-x auto-bs-mode