Re: Seeking help with a Perl module for translating languages

  • From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 15 Oct 2008 23:15:01 +0300

I already sent to the list the details about how to install those perl modules. Tell me if the message didn't reach on the list, because I don't get the messages I send.


Octavian

----- Original Message ----- From: "Jamal Mazrui" <empower@xxxxxxxxx>
To: <ProgrammingBlind@xxxxxxxxxxxxx>
Sent: Wednesday, October 15, 2008 10:30 PM
Subject: Re: Seeking help with a Perl module for translating languages


Jim and Octavian, When you get a chance, I'm still interested in more info
on your solutions, including how to get the needed modules.  After
updating to the latest build of Perl 5.8, I did find a module that uses
the Google translation service.  The code below translates the English
"Hello world" into the French "Bonjour le monde."

Jamal


use strict;
use warnings;

use WebService::Google::Language;

my $service = WebService::Google::Language->new(
'referer' => 'http://example.com/',
'src'     => 'en',
'dest'    => 'fr',
);

my $Text = 'Hello world';
my $result = $service->translate($Text);

if ($result->error) {
printf "Error code: %s\n", $result->code;
printf "Message:    %s\n", $result->message;
}
else {
printf "Translation:       %s\n", $result->translation;
}

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: