projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check file exists
[Pman.Core]
/
Pman.GoogleTranslate.js
diff --git
a/Pman.GoogleTranslate.js
b/Pman.GoogleTranslate.js
index
8813b9a
..
0a4fcfb
100644
(file)
--- a/
Pman.GoogleTranslate.js
+++ b/
Pman.GoogleTranslate.js
@@
-127,10
+127,24
@@
Pman.GoogleTranslate = function(str, src, dest, cb, force) {
src = src.replace('_','-');
dest = dest.replace('_','-');
// google does not recognize HK...
src = src.replace('_','-');
dest = dest.replace('_','-');
// google does not recognize HK...
- if (src == 'zh') src = 'zh-CN';
- if (dest == 'zh') dest = 'zh-CN';
- if (src == 'zh-HK') src = 'zh-TW';
- if (dest == 'zh-HK') dest = 'zh-TW';
+
+ switch(dest){
+ case 'zh':
+ src = 'zh-CN';
+ break;
+ case 'zh-HK':
+ src = 'zh-TW';
+ break;
+ }
+
+ switch(dest){
+ case 'zh':
+ dest = 'zh-CN';
+ break;
+ case 'zh-HK':
+ dest = 'zh-TW';
+ break;
+ }
new Pman.Request({
url : baseURL + '/Core/GoogleTranslate.php',
new Pman.Request({
url : baseURL + '/Core/GoogleTranslate.php',
@@
-140,7
+154,7
@@
Pman.GoogleTranslate = function(str, src, dest, cb, force) {
params : {
text : str,
src : src,
params : {
text : str,
src : src,
- dest : dest
,
+ dest : dest
},
success: function(o)
{
},
success: function(o)
{