NAME

Locale::TextDomain::OO::Extract::TT - Extracts internationalization data from TemplateToolkit code

$Id: TT.pm 252 2009-12-29 13:55:33Z steffenw $

$HeadURL: https://perl-gettext-oo.svn.sourceforge.net/svnroot/perl-gettext-oo/trunk/lib/Locale/TextDomain/OO/Extract/TT.pm $

VERSION

0.04

DESCRIPTION

This module extracts internationalization data from Template code.

Implemented rules:

[%l('...

Whitespace is allowed everywhere.

SYNOPSIS

use Locale::TextDomain::OO::Extract::TT;

SUBROUTINES/METHODS

method new

All parameters are optional. See Locale::TextDomain::OO::Extract to replace the defaults.

my $extractor = Locale::TextDomain::OO::Extract::TT->new(
    # where to store the pot file
    pot_dir => './',

    # how to store the pot file
    # - The meaning of undef is ISO-8859-1 but use not Perl unicode.
    # - Set 'ISO-8859-1' to have a ISO-8859-1 pot file and use Perl unicode.
    # - Set 'UTF-8' to have a UTF-8 pot file and use Perl unicode.
    # And so on.
    pot_charset => undef,

    # add some key value pairs to the header
    # more see documentation of DBD::PO
    pot_header => { ... },
);

method extract

The default pot_dir is "./".

Call

$extractor->extract('dir/filename.tt');

to extract "dir/filename.tt" to have a "$pot_dir/dir/filename.tt.pot".

Call

open my $file_handle, '<', 'dir/filename.tt'
    or croak "Can no open file dir/filename.tt\n$OS_ERROR";
$extractor->extract('filename', $file_handle);

to extract "dir/filename.tt" to have a "$pot_dir/filename.pot".

EXAMPLE

Inside of this distribution is a directory named example. Run this *.pl files.

DIAGNOSTICS

see Locale::TextDomain::OO::Extract

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

version

parent

Locale::TextDomain::OO::Extract

INCOMPATIBILITIES

not known

BUGS AND LIMITATIONS

none

SEE ALSO

Locale::TextDoamin::OO

Template

AUTHOR

Steffen Winkler

LICENSE AND COPYRIGHT

Copyright (c) 2009, Steffen Winkler <steffenw at 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.