Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정민혁
/
TermProject_KakaoBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
정민혁
2018-12-10 01:04:09 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ff43e0971b864de5ce451d8da136734773ea3908
ff43e097
1 parent
b171dc7b
파파고에서 지원하는 모든 언어 번역기능 추가
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletions
routes/message.js
routes/message.js
View file @
ff43e09
...
...
@@ -9,6 +9,8 @@ var client_secret = 'Ot0BMdWXOJ';
var
api_url
=
'https://openapi.naver.com/v1/language/translate'
;
var
source
=
'ko'
;
var
target
=
'en'
;
//일본어 ja , 중국어 간체 zh-CN , 중국어 번체 zh-TW
//what kind of task to do
var
translate
=
false
;
var
dictionary
=
false
;
...
...
@@ -31,7 +33,8 @@ app.post('/', function(req, res) {
},
"keyboard"
:
{
"type"
:
"buttons"
,
"buttons"
:[
"한-영"
,
"영-한"
]
"buttons"
:[
"한-영"
,
"영-한"
,
"한-일"
,
"일-한"
,
"한-중국어간체"
,
"중국어간체-한"
,
"한-중국어번체"
,
"중국어번체-한"
]
}
});
}
else
if
(
_obj
.
content
==
'번역'
){
...
...
@@ -148,6 +151,36 @@ app.post('/', function(req, res) {
source
=
"en"
;
target
=
"ko"
;
}
else
if
(
_obj
.
content
==
"한-일"
)
{
source
=
"ko"
;
target
=
"ja"
;
}
else
if
(
_obj
.
content
==
"일-한"
)
{
source
=
"ja"
;
target
=
"ko"
;
}
else
if
(
_obj
.
content
==
"한-중국어간체"
)
{
source
=
"ko"
;
target
=
"zh-CN"
;
}
else
if
(
_obj
.
content
==
"중국어간체-한"
)
{
source
=
"zh-CN"
;
target
=
"ko"
;
}
else
if
(
_obj
.
content
==
"한-중국어번체"
)
{
source
=
"ko"
;
target
=
"zh-TW"
;
}
else
if
(
_obj
.
content
==
"중국어번체-한"
)
{
source
=
"zh-TW"
;
target
=
"ko"
;
}
console
.
log
(
source
,
target
);
res
.
json
({
"message"
:
{
...
...
Please
register
or
login
to post a comment