The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

WWW::Search::Translator - class for Translating languages

SYNOPSIS

  use WWW::Search;
  %opts = (
  lp => param(en_de),
  );
 $query = "a whole bunch of english text to be translated to german";
 my $search = new WWW::Search('Translator');
 $search->native_query(WWW::Search::escape_query($query),\%opts);
  while (my $result = $search->next_result())
    { 
    $p = $result->raw;
    print "$p"; 
    }

DESCRIPTION

This is a simple no thrills class enabling users to translate text through AV Translations http://babel.altavista.com. This translating via this method seems much faster than thru browser interface. Makes a neat addition to any web page. Translated text is returned thru $result->raw, there is no url's or title $results like typical WWW::Search results, just a stream of text that was translated from the query text entered.

SEE TRANSLATION OPTIONS and TIPS.

This class exports no public interface; all interaction should be done through WWW::Search objects.

TRANSLATION OPTIONS

Pass either of the below listed value options along with the query. There is only one $result returnd by this backend: raw. Thus, translated text will be returnd via $result->raw

<option value="en_fr" >English to French</option> <option value="en_de" >English to German</option> <option value="en_it" >English to Italian</option> <option value="en_pt" >English to Portuguese</option> <option value="en_es" >English to Spanish</option> <option value="fr_en" >French to English</option> <option value="de_en" >German to English</option> <option value="it_en" >Italian to English</option> <option value="pt_en" >Portuguese to English</option> <option value="es_en" >Spanish to English</option> <option value="de_fr" >German to French</option> <option value="fr_de" >French to German</option> <option value="ru_en" >Russian to English</option>

TIPS

I would use textarea for both user input and printing $result->url into. This way users can scroll the returned text and have large area to type/paste text for input.

CHANGES

VERSION 1.02

Got time to go back and look at what was needed to parse multi lines of the text area. Everything looks OK now and this backend will parse single and multi lines of translated text.

AUTHOR

WWW::Search::Translator is written and maintained by Jim Smyser - <jsmyser@bigfoot.com>.

COPYRIGHT

WWW::Search Copyright (c) 1996-1998 University of Southern California. All rights reserved.

THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.