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

index e10f291..bdd59d0 100644 (file)
@@ -129,7 +129,9 @@ Pman.GoogleTranslate = function(str, src, dest, cb, force) {
         // google does not recognize HK...
         if (src  == 'zh-HK')  src = 'zh-TW';
         if (dest == 'zh-HK') dest = 'zh-TW';
-     
+        
+        var ret = '';
+        
         new Pman.Request({
             url : baseURL + '/Core/GoogleTranslate.php',
             method :'POST',
@@ -151,13 +153,16 @@ Pman.GoogleTranslate = function(str, src, dest, cb, force) {
                     return;
                 }
 //                Roo.MessageBox.alert("Success", "We logged in OK")
-                return o.data.data.translations[0].translatedText;
+                str = o.data.data.translations[0].translatedText;
             },
             failure: function (res) {
                 Roo.log(res);
                 Roo.MessageBox.alert("Failure ", res.data.error.message);
             }
         });
+        
+        return ret;
+        
 //        
 //        x.load(
 //            {