김민경

test

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