projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
34d24f6
)
Pman.GoogleTranslate.js
author
Chris
<chris@roojs.com>
Wed, 2 Apr 2014 14:01:35 +0000
(22:01 +0800)
committer
Chris
<chris@roojs.com>
Wed, 2 Apr 2014 14:01:35 +0000
(22:01 +0800)
Pman.GoogleTranslate.js
patch
|
blob
|
history
diff --git
a/Pman.GoogleTranslate.js
b/Pman.GoogleTranslate.js
index
8813b9a
..
bdc548e
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',