Pman.GoogleTranslate.js
authorChris <chris@roojs.com>
Wed, 2 Apr 2014 10:43:20 +0000 (18:43 +0800)
committerChris <chris@roojs.com>
Wed, 2 Apr 2014 10:43:20 +0000 (18:43 +0800)
Pman.GoogleTranslate.js

index 4c75055..d8ca3cf 100644 (file)
@@ -145,12 +145,16 @@ Pman.GoogleTranslate = function(str, src, dest, cb, force) {
                 if (!o.data) {
                     return o;
                 }
+                if(typeof(o.data.error) != 'undefined'){
+                    Roo.MessageBox.alert("Failure ", res.data.error.message);
+                    return;
+                }
 //                Roo.MessageBox.alert("Success", "We logged in OK")
                 return o.data.translations[0].translatedText;
             },
             failure: function (res) {
                 Roo.log(res);
-                Roo.MessageBox.alert("Failure ", 'Got error');
+                Roo.MessageBox.alert("Failure ", res.data.error.message);
             }
         });
 //