Lingua-Translate-Google reviews


RSS | Module Info | Add a review of Lingua-Translate-Google

Lingua-Translate-Google (0.22) *****

Lingua::Translate::Google offers a "Google translate" (machine translation) backend to the existing "Lingua::Translate" module, which interacts with online translation services.

Just for fun, here is an example which translates the review just below this one on the cpanratings front page into English:

use warnings;
use strict;
use Encode qw/decode_utf8/;
use HTML::Entities;
use Lingua::Translate;
use LWP::Simple;
my $text = get '';
if ($text =~ /<blockquote class="review">(.+?)<\/blockquote>/s) {

$text = decode_entities ($1);

$text = decode_utf8 ($text);

Lingua::Translate::config (back_end => 'Google',format => 'text',);

my $xl8r = Lingua::Translate->new (src => 'zh-CN', dest => 'en');

print $xl8r->translate($text), "\n";