feat: add translation API (#297)

* feat: add translation

* feat: resurface translation by Google Translation

* feat: renamed the service as `translate` to make more readable

* fix: renamed response and request name to match rpc name

* chore: delete useless blank line

* Update publicapi.json

* Update publicapi.json

* Update README.md

Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
zhaoyang
2021-12-10 18:15:57 +08:00
committed by GitHub
parent 1d6234155a
commit 4ec7a7aa5c
15 changed files with 674 additions and 0 deletions

33
translate/examples.json Normal file
View File

@@ -0,0 +1,33 @@
{
"text": [
{
"title": "Translate String",
"run_check": false,
"description": "Google Basic Edition Translation",
"request": {
"contents": [
"pen",
"pencil"
],
"model": "nmt",
"format": "text",
"source": "en",
"target": "zh"
},
"response": {
"translations": [
{
"text": "钢笔",
"source": "und",
"model": "nmt"
},
{
"text": "铅笔",
"source": "und",
"model": "nmt"
}
]
}
}
]
}