How to decode Google translate response with php?
//this will translate from en to ar -- you can change it for your needs function translate_word($en){ $file_content = file_get_contents('http://translate.google.com/translate_a/t?client=p&sl=auto&tl=ar&hl=en&sc=2&ie=UTF-8&oe=UTF-8&uptl=ar&oc=1&prev=conf&psl=auto&ptl=en&otf=1&it=sel.8936&ssel=0&tsel=3&q='.str_replace(" ","%20",$en)); $obj = json_decode($file_content); if(!empty($obj->sentences[0]->trans)){ return $obj->sentences[0]->trans; }else{ return $en; }}//how to useecho translate_word("test translation process");//if you do not know short codes for your language you can just open
translate.google.com and do described on screenshot
//you should have firebug extension installed on your browser
//if the answer was usefull please do not forget to vote up! thanks.