$this->jerr("Google API Key not configured");
}
- $apiKey = $pc['googlekey'];
-
- $text = 'Hello world!';
$param = array(
'key' => $pc['googlekey'],
'q' => rawurlencode($_REQUEST['text']),
'target' => $_REQUEST['dest']
);
- $url = 'https://www.googleapis.com/language/translate/v2?key='.
- $apiKey.
- '&q='.
- rawurlencode($text).
- '&source=en&target=fr';
+ $url = 'https://www.googleapis.com/language/translate/v2?'.http_build_query($param);
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_close($handle);
- $this->jdata($key);
+ $this->jdata($responseDecoded);
}