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'); Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/page/2/#findComment-791597 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 Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/page/2/#findComment-791604 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 ! Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/page/2/#findComment-793359 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. Link to comment https://forums.phpfreaks.com/topic/150635-how-to-translate-a-php-script-to-another-language/page/2/#findComment-793378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.