Skip to content

13061051/google-translate-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

translate

A local server can be used as a local translate server, using https://translate.google.cn/translate_a/single as backend.

Build and Run

Clone this repository to some directory, then

npm install --save-dev
node index.js [port]

The default port is 3001, if there's no port argument provided via command line.

API

  • path: /translate

  • method: POST

  • request:

    • body: {text: '...'},
    • desc: text的长度不可超过4000字符
  • response:

    • on success: {error: 0, result: '...'}
    • on error: {error: 非零整数, message: '....'}

Acknowledge

Inspired by https://github.com/yixianle/translate-api and token is generated by https://github.com/jerry-i/google-translate-token-plus.

Releases

No releases published

Packages

No packages published