Daniel0 Posted March 23, 2009 Share Posted March 23, 2009 May I ask why you first link to the API, but don't use it anyway? You can just call the API directly instead of parsing the output of the translating frontend... function translate($textSource, $langSource, $langTarget) { $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => 'http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=' . urlencode($textSource) . '&langpair=' . urlencode($langSource . '|' . $langTarget), CURLOPT_RETURNTRANSFER => true )); $ret = json_decode(curl_exec($ch), true); curl_close($ch); if ($ret['responseStatus'] != '200') { throw Exception('Translation failed.'); } return $ret['responseData']['translatedText']; } echo translate('ciao', 'it', 'en'); Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted March 23, 2009 Share Posted March 23, 2009 google seems like his best bet the output will not be perfect in arabic but I am sure he could edit it so it makes sense. http://translate.google.com/ I translated a site from english to chinese using google and it was a far from perfect translation lol Quote Link to comment Share on other sites More sharing options...
samoi Posted March 25, 2009 Author Share Posted March 25, 2009 Guys !!? I asked a question and you got it to another way !!! Please stop persuading and help me THAT'S IT !!!! If you won't help me, then DON'T POST ! Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 25, 2009 Share Posted March 25, 2009 Here is your help: Become proficient in both languages and do it manually. That's the only way I'm afraid, and you were already told that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.