Jump to content

Gtranslate


alin19

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.