#1556 babelfish text links don't work

v1.8.3
open
nobody
5
2012-12-08
2004-07-14
No

The babelfish "Translate to ..." text links have
stopped working, ever since jump.altavista.com
disappeared. So only the big logo (which is better as a
module rather than at the bottom of the page) still works.

To fix it, you need to edit lib/Babelfish.php, to fix
the url function, thus:

function url\($lang\_from, $lang\_to\) \{
    static $url\_map = array\(
        'en'    => 'english',
        'fr'    => 'french',
        'de'    => 'german',
        'it'    => 'italian',
        'es'    => 'spanish',
        'pt'    => 'portugese',
    \);

    $lang\_from = strtolower\($lang\_from\);
    $lang\_to = strtolower\($lang\_to\);

    if \(\!isset\($url\_map\[$lang\_from\]\)\) \{
        return '';
    \}

    $url =

'http://babelfish.altavista.com/babelfish/tr?doit=done' .
'&lp=' . $lang_from . '_' . $lang_to .
'&url=http';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ==
'on') {
$url .= 's';
}
$url .= '://' . Babelfish::host() .
$_SERVER['REQUEST_URI'];
return $url;
}

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks