Well I'm trying to translate a text with php but I can not find a functional api. I tried to make it work as follows
<html>
<head>
<title>Teste</title>
</head>
<body>
<form action="#" >
<textarea name="texto"></textarea>
<input type="submit" value="Traduzir"/>
</form>
<?php
$texto = $_POST['texto'];
$language = "pt_BR";
$language_for= "en";
if($texto != NULL){
//aqui a tradução
}else{
echo "Sem Texto Para Traduzir";
}
?>
</body>
</html>
How can I make this work? PS: I need this text to be translated with the help of some api because the text is randomly picked up on another site.