Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Template::Multilingual 0.08

    Download button

    No screenshots available
    Downloads: 313  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Eric Cholet | More programs
    Perl Artistic License / FREE
    April 6th, 2007, 19:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Template::Multilingual description

    Template::Multilingual is a Perl module with multilingual templates for Template Toolkit.

    Template::Multilingual is a Perl module with multilingual templates for Template Toolkit.

    SYNOPSIS

    This subclass of Template Toolkit's Template class supports multilingual templates: templates that contain text in several languages.

    < t >
    < en >Hello!< /en >
    < fr >Bonjour !< /fr >
    < /t >

    Specify the language to use when processing a template:

    use Template::Multilingual;

    my $template = Template::Multilingual->new();
    $template->language('en');
    $template->process('example.ttml');

    You can also provide the name of the template variable that will hold the language:

    my $template = Template::Multilingual->new(LANGUAGE_VAR => 'foo');
    $template->process('example.ttml', { foo => 'en' });

    METHODS

    new(%params)

    The new() constructor creates and returns a reference to a new template object. A reference to a hash may be supplied as a parameter to provide configuration values.

    Configuration values are all valid Template superclass options, and one specific to this class:

    LANGUAGE_VAR

    The LANGUAGE_VAR option can be used to set the name of the template variable which contains the current language.

    my $parser = Template::Multilingual->new({
    LANGUAGE_VAR => 'global.language',
    });

    If this option is set, you code is responsible for setting the variable's value to the current language when processing the template. Calling language() will have no effect.

    If this option is not set, it defaults to language.

    language($lcode)

    Specify the language to be used when processing the template. Any string that matches w+ is fine, but we suggest sticking to ISO-639 which provides 2-letter codes for common languages and 3-letter codes for many others.

    process

    Used exactly as the original Template Toolkit process method. Be sure to call language before calling process.

    Requirements:

    · Perl



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    multilingual templates | Template Toolkit | Perl module | Template::Multilingu | multilingual | templates

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM