PHP and google translator API alternative

Since Google is going to pull the plugin out of its translator API (by the end of this year), is there anyone who has already found a good (free or $) alternative?

+3
source share
4 answers

Try TranslateThis at http://translateth.is/ ...

Very simple! To see the effects, try this piece of code:

<!-- Begin TranslateThis Button -->

<div id="translate-this"><a style="width:180px;height:18px;display:block;" class="translate-this-button" href="http://translateth.is/">Translate</a></div>

<script type="text/javascript" src="http://x.translateth.is/translate-this.js"></script>
<script type="text/javascript">
TranslateThis();
</script>

<!-- End TranslateThis Button -->

Don't worry about the button aspect ... you can customize it!

+2
source

Google also offers an alternative to site translation. Its GOOGLE WEB ELEMENTS and some google websites homepage code for translation

<!-- Google Translate Element -->
<div id="google_translate_element" style="display:block"></div><script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: "af"}, "google_translate_element");
};</script>

: Microsoft HTTP, SOAP SDK .

0

, API:

http://detectlanguage.com

It produces JSON output, like Google Translate.

0
source

use this:

$string = 'questo è un testo di prova';
$data = file_get_contents('http://translate.google.com/translate_a/t?client=p&tl=en&ie=UTF-8&oe=UTF-8&text='.urlencode($string));
$data = json_decode($data);
echo $data->src;

it's an echo of "it" for Italian

0
source

All Articles