
Originally Posted by
Alejandro Weber
Is this version still restricted only to english in the original site? My site is in spanish language and I would like to translate it to the other major languajes using your script.
Changing the script to use Spanish as the source language should be fairly simple to accomplish.
You would have to edit translate/translate.php by replacing "en" with "es":
Before
Code:
//Define translation engines here
$engines = array(
'g' => array( 'trans_url' => 'http://translate.google.com/translate_c?hl=en&langpair=en%7C$lang&u=$url',
'timeout' => 180,
'max_redir' => 3,
'check_func' => 'GoogleCheck', //This function should determine if the translation was successful
'fixup_func' => 'GoogleFixup'
),
//TODO: Yahoo translation requires an IP hostname, should code a workaround for this
'y' => array( 'trans_url' => 'http://72.30.186.56/babelfish/translate_url_content?lp=en_$lang&trurl=$url',
'timeout' => 180,
'max_redir' => 3,
'check_func' => 'YahooCheck',
'fixup_func' => 'YahooFixup'
)
After
Code:
//Define translation engines here
$engines = array(
'g' => array( 'trans_url' => 'http://translate.google.com/translate_c?hl=fr&langpair=fr%7C$lang&u=$url',
'timeout' => 180,
'max_redir' => 3,
'check_func' => 'GoogleCheck', //This function should determine if the translation was successful
'fixup_func' => 'GoogleFixup'
),
//TODO: Yahoo translation requires an IP hostname, should code a workaround for this
'y' => array( 'trans_url' => 'http://72.30.186.56/babelfish/translate_url_content?lp=fr_$lang&trurl=$url',
'timeout' => 180,
'max_redir' => 3,
'check_func' => 'YahooCheck',
'fixup_func' => 'YahooFixup'
)
Bookmarks