Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC |
Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC
This document describes Hyper::Template::HTC::Plugin::Text 0.01
ATTENTION: You always need a valid the Hyper::Singleton::Context manpage for this plugin.
use HTML::Template::Compiled; my $htc = HTML::Template::Compiled->new( plugin => [qw(Hyper::Template::HTC::Plugin::Text)], scalarref => \'<%TEXT VALUE="Hello World!" %>', ); $htc->output();
Hyper::Template::HTC::Plugin::Text connects the Hyper::Translator manpages to the HTML::Template::Compiled manpage. The Plugin allows you to create multilingual templates including maketext features (assumed that your Translator supports this).
<%TEXT VALUE="some static text" %>
<%TEXT a.var %>
<%TEXT VALUE="Hello [_1]!" _1="Damian" %>
<%TEXT VALUE="Hello [_1]!" _1_VAR="var.with.the.value" %>
<%TEXT a.text _1="Damian" _2="Conway" %>
<%TEXT VALUE="[_1] has [_2] points!" _1="Larry" _2_VAR="var.with.points" %>
<%TEXT a.complex.text _1="Larry" _2="Wall" _3_VAR="var.with.points" %>
Callback which is used by the HTML::Template::Compiled manpage to register the plugin.
Don't call this method, it's used to create the HTC Template Code. This method is used as callback which is registerd to the HTML::Template::Compiled manpage by our register method.
It calls the translate method of the Translator found via
Hyper::Singleton::Context->singleton()->get_config('Class')->get_translator()
The translate method is called like
$translator_class->translate( 'result of variable lookup or VALUE', { maketext => [], # maketext params from eg. _1 _2_VAR escape => ['WIKI'], # escape eg. ESCAPE="WIKI" or ESCAPE="HTML|TEXTILE" etc. filename => '', # template's filename or undef if no filename existant } );
Internally used to lookup variables in the HTML::Template::Compiled manpage
Use the Hyper::Singleton::Context manpage for your configuration.
$Author: ac0v $
$Id: Text.pm 317 2008-02-16 01:52:33Z ac0v $
$Revision: 317 $
$Date: 2008-02-16 02:52:33 +0100 (Sa, 16 Feb 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Template/HTC/Plugin/Text.pm $
Andreas Specht <ACID@cpan.org>
Copyright (c) 2007, Andreas Specht <ACID@cpan.org>
.
All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC |