
Hi skunks & skunkettes, Is there a known class/function for doing language conversion ie arbitrary text from say english to chinese[traditional]. The google API is AJAX driven that 'might' pose a problem in the process of page rendering [javascript => php] Any ideas/clues?

What about if you used JSON/XML to pass around your data to the google API?

After running around the last few hours this is my solution which fortunately/unfortunately uses the google API through the cURL <?php $text = "Hello World."; $language = "&langpair=".urlencode("en|ja"); $lookup_url = " http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q= ".urlencode($text).$language; $result = geturl($lookup_url); $meta = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n"; print $meta; $x = json_decode($result, true); if($x["responseStatus"] != 200){ $str = $x["responseDetails"]; } else{ $str = $x["responseData"]["translatedText"]; } print $str; function geturl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); //print_r($output); curl_close($ch); return $output; } ?> On Thu, Oct 28, 2010 at 9:47 AM, Dennis Kioko <dmbuvi@gmail.com> wrote:
What about if you used JSON/XML to pass around your data to the google API?
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
participants (2)
-
Dennis Kioko
-
Nd'wex Common