Stefan Hornburg (Racke) > Template-Flute-0.0064 > Template::Flute::I18N

Download:
Template-Flute-0.0064.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Template-Flute-0.0114

NAME ^

Template::Flute::I18N - Localization class for Template::Flute

SYNOPSIS ^

    %german_map = (Cart=> 'Warenkorb', Price => 'Preis');

    sub translate {
        my $text = shift;

        return $german_map{$text};
    };

    $i18n = Template::Flute::I18N->new(\&translate);

    $flute = Template::Flute(specification => ...,
                             template => ...,
                             i18n => $i18n);

CONSTRUCTOR ^

new [CODEREF]

Create a new Template::Flute::I18N object. CODEREF is used by localize method for the text translation.

METHODS ^

localize STRING

Calls localize function with provided STRING. The result is returned if it contains non blank characters. Otherwise the original STRING is returned.

AUTHOR ^

Stefan Hornburg (Racke), <racke@linuxia.de>

LICENSE AND COPYRIGHT ^

Copyright 2010-2013 Stefan Hornburg (Racke) <racke@linuxia.de>.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: