REST::Google::Translate2 - OO interface to Google Translate API v2
Version 1.08
use REST::Google::Translate2; REST::Google->http_referer('http://example.com/'); my $res = REST::Google::Translate2->new( q => 'hello world', source => 'en', target => 'it', key => $Your_Google_API_Key ); die "response status failire" if $res->responseStatus != 200; my $translated = $res->responseData->translatedText; printf "Italian translation: %s\n", $translated;
REST::Google::Translate2 is an update to Eugen Sobchenko's REST::Google::Translate module that works with the Google Translate API v2. Version 1 of this API has been unavailable since late 2011.
REST::Google::Translate2
REST::Google - the base class for this module
REST::Google::Translate - earlier version of this module.
Marty O'Brien, <mob at cpan.org>
<mob at cpan.org>
Eugen Sobchenko <ejs at cpan.org>
<ejs at cpan.org>
Copyright 2012, Marty O'Brien. Copyright 2008, Eugen Sobchenko.
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.
To install REST::Google::Translate2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm REST::Google::Translate2
CPAN shell
perl -MCPAN -e shell install REST::Google::Translate2
For more information on module installation, please visit the detailed CPAN module installation guide.