From 101d23f766e99f3c428a9190c0176376a11a0be3 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 2 Apr 2014 21:03:27 +0800 Subject: [PATCH] GoogleTranslate.php --- GoogleTranslate.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GoogleTranslate.php b/GoogleTranslate.php index 1d22a52c..3163de89 100644 --- a/GoogleTranslate.php +++ b/GoogleTranslate.php @@ -56,8 +56,11 @@ class Pman_Core_GoogleTranslate extends Pman if(!empty($responseDecoded->error)){ $this->jerr($responseDecoded->error->message); } - print_r($responseDecoded); - $responseDecoded->data->translations[0]->translatedText = rawurldecode($responseDecoded->data->data->translations[0]->translatedText); +// print_r($responseDecoded); + if(empty($responseDecoded->data->translations[0]->translatedText)){ + $this->jerr('does not have translated text.'); + } + $responseDecoded->data->translations[0]->translatedText = rawurldecode($responseDecoded->data->translations[0]->translatedText); $this->jok($responseDecoded->data->translations[0]); } -- 2.39.2