Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC


Back to Top


NAME

Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC

Back to Top


VERSION

This document describes Hyper::Template::HTC::Plugin::Text 0.01

Back to Top


SYNOPSIS

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();

Back to Top


DESCRIPTION

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).

Back to Top


SYNTAX

static text values
    <%TEXT VALUE="some static text" %>
text from a variable
    <%TEXT a.var %>
maketext with an static value
    <%TEXT VALUE="Hello [_1]!" _1="Damian" %>
maketext with an variable
    <%TEXT VALUE="Hello [_1]!" _1_VAR="var.with.the.value" %>
mixed samples
    <%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" %>

Back to Top


SUBROUTINES/METHODS

register

Callback which is used by the HTML::Template::Compiled manpage to register the plugin.

TEXT

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
        }
    );

_lookup_variable

Internally used to lookup variables in the HTML::Template::Compiled manpage

Back to Top


DIAGNOSTICS

Back to Top


CONFIGURATION AND ENVIRONMENT

Use the Hyper::Singleton::Context manpage for your configuration.

Back to Top


DEPENDENCIES

Back to Top


INCOMPATIBILITIES

Back to Top


BUGS AND LIMITATIONS

Back to Top


RCS INFORMATIONS

Last changed by

$Author: ac0v $

Id

$Id: Text.pm 317 2008-02-16 01:52:33Z ac0v $

Revision

$Revision: 317 $

Date

$Date: 2008-02-16 02:52:33 +0100 (Sa, 16 Feb 2008) $

HeadURL

$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Template/HTC/Plugin/Text.pm $

Back to Top


AUTHOR

Andreas Specht <ACID@cpan.org>

Back to Top


LICENSE AND COPYRIGHT

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.

Back to Top

 Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC