이유혁

Merge branch 'develop' of ssh://khuhub.khu.ac.kr:12959/2015104204/OSS_Project_Chatbot into develop

Showing 1 changed file with 7 additions and 4 deletions
...@@ -72,9 +72,12 @@ function handleEvent(event) { ...@@ -72,9 +72,12 @@ function handleEvent(event) {
72 72
73 73
74 //번역은 한국어->영어 / 영어->한국어만 지원 74 //번역은 한국어->영어 / 영어->한국어만 지원
75 - if(detect_body.langCode == 'ko'||detect_body.langCode == 'en'){ 75 + if(detect_body.langCode == 'ko'||detect_body.langCode == 'en'||detect_body.langCode=='ru'||detect_body.langCode=='ja'){
76 - source = detect_body.langCode == 'ko' ? 'ko':'en'; 76 + source = detect_body.langCode;
77 - target = source == 'ko' ? 'en':'ko'; 77 + if(source!='ko'){
78 + target='ko';
79 + }
80 + // target = source == 'ko' ? 'en':'ko';
78 //papago 번역 option 81 //papago 번역 option
79 var options = { 82 var options = {
80 url: translate_api_url, 83 url: translate_api_url,
...@@ -102,7 +105,7 @@ function handleEvent(event) { ...@@ -102,7 +105,7 @@ function handleEvent(event) {
102 else{ 105 else{
103 result.text = '언어를 감지할 수 없습니다. \n 번역 언어는 한글 또는 영어만 가능합니다.'; 106 result.text = '언어를 감지할 수 없습니다. \n 번역 언어는 한글 또는 영어만 가능합니다.';
104 client.replyMessage(event.replyToken,result).then(resolve).catch(reject); 107 client.replyMessage(event.replyToken,result).then(resolve).catch(reject);
105 - } 108 + }
106 109
107 } 110 }
108 111
......