NAME

Text::Pipe::Translate - Translate text from one language to another

SYNOPSIS

use Text::Pipe 'pipe';
my $pipe = pipe 'Translate::Babelfish', from => 'en', to => 'de';
my $german = $pipe->filter('My hovercraft is full of eels.'),

DESCRIPTION

This pipe segment can translate text from one language to another. To do so it uses Lingua::Translate.

Text::Pipe::Translate inherits from Text::Pipe::Base.

METHODS

clear_from
$obj->clear_from;

Clears the value.

clear_to
$obj->clear_to;

Clears the value.

clear_translators
$obj->clear_translators;

Clears the value.

from
my $value = $obj->from;
$obj->from($value);

A basic getter/setter method. If called without an argument, it returns the value. If called with a single argument, it sets the value.

from_clear
$obj->from_clear;

Clears the value.

to
my $value = $obj->to;
$obj->to($value);

A basic getter/setter method. If called without an argument, it returns the value. If called with a single argument, it sets the value.

to_clear
$obj->to_clear;

Clears the value.

translators
my $value = $obj->translators;
$obj->translators($value);

A basic getter/setter method. If called without an argument, it returns the value. If called with a single argument, it sets the value.

translators_clear
$obj->translators_clear;

Clears the value.

from

The source language, in RFC3066 form. See I18N::LangTags. There is no default.

to

The destination language, in RFC3066 form. See I18N::LangTags. There is no default.

get_translator

Constructs a translator object for the current settings of from() and to() and caches it using the translators() accessor.

filter_single

Takes a string and translates it according to the current settings of from() and to().

TAGS

If you talk about this module in blogs, on del.icio.us or anywhere else, please use the textpipetranslate tag.

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to <bug-text-pipe-translate@rt.cpan.org>, or through the web interface at http://rt.cpan.org.

INSTALLATION

See perlmodinstall for information and options on installing Perl modules.

AVAILABILITY

The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>.

AUTHOR

Marcel Grünauer, <marcel@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2007 by Marcel Grünauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.