check file exists
[Pman.Core] / GoogleTranslate.php
index f5de448..8d9c464 100644 (file)
@@ -20,12 +20,12 @@ class Pman_Core_GoogleTranslate extends Pman
         
         $this->authUser = $au;
     }
-    function get() {
+    function get($v, $opts=array()) {
         // for testing..
         return $this->post();
     }
     
-    function post()
+    function post($v)
     {
         $pc = HTML_FlexyFramework::get()->Pman_Core;
         if (empty($pc['googlekey'])) {
@@ -42,7 +42,6 @@ class Pman_Core_GoogleTranslate extends Pman
             'format' => 'text',
         );
         
-        
         $url = 'https://www.googleapis.com/language/translate/v2';
 
         $handle = curl_init();
@@ -60,16 +59,6 @@ class Pman_Core_GoogleTranslate extends Pman
         header("content-type: text/json");
         echo $response;
         exit;
-        if(!empty($responseDecoded->error)){
-            $this->jerr($responseDecoded->error->message);
-        }
-//        print_r($responseDecoded);
-        if(empty($responseDecoded->data->translations[0]->translatedText)){
-            $this->jerr('does not have translated text.', print_r($responseDecoded, true));
-        }
-//        var_dump($responseDecoded->data->translations[0]->translatedText);
-        $responseDecoded->data->translations[0]->translatedText = rawurldecode(str_replace(' ', '', $responseDecoded->data->translations[0]->translatedText));
-        $this->jok($responseDecoded->data->translations[0]);
         
     }