alin19 Posted September 9, 2010 Share Posted September 9, 2010 I work on translating about 1200 k of phrases from japanese to english After about 150 requested translations it stops throwing the error i showed in the title, the requests are done under 60 seconds (the whole 150); I run this php scrip as cli script i use this method from a class public function TranslateDetails(){ $get=$this->conn->select("select `details`.*,`summary`.`id` 'sum_id' from `summary`,`details` where `summary`.`id`=`details`.`summary_id` and `summary`.`details_translated`=0"); if(sizeof($get)>0) foreach($get as $each) { if($each['text']=="") continue; try { $text=$this->Translate($each['text']); } catch (GTranslateException $e){ echo $e; die("Stoped"); } $this->conn->update("update `details` set `text`='".$text."' where `id`=".$each['id']); $this->conn->update("update `summary` set `details_translated`=1 where `id`=".$each['sum_id']); echo date("H:i:s"),"\t","Translated Details: ",$each['id'],PHP_EOL; } } The problem is that after about 150 translation per minute it throws an exception. Has anybody used this class? How can i have access to translate unlimited words? Thanks. Link to comment https://forums.phpfreaks.com/topic/212962-gtranslate/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.