0.4.0 • Published 4 years ago

baidu-translate-api-proxy v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

baidu-translate-api npm

A free and unlimited API for Baidu Translate

Translations

Install

npm install --save baidu-translate-api 

or

yarn add baidu-translate-api

Usage

const translate = require("baidu-translate-api");

translate("让我们来翻译吧!").then(res => {
    console.log(res.trans_result.dst);
    // Let's translate it!
});

API

translate(query, options)

query

Type: String

The text to be translated

options

Type: Object

  • from

    Type: String Default: auto

    The language in which the query text or auto. Contain in Languages

  • to

    Type: String Default: en

    The language in which the text should be translated. Contain in Languages

Returns an object:

  • from - The lanuage in which the query text.
  • to
  • trans_result (object)

    • dst - The translation
    • src - The source (equal to query)

Languages

abbrname
autoAutomatic detection
zhChinese
enEnglish
yueCantonese
wywClassical Chinese
jpJapanese
korKorean
fraFrench
spaSpanish
thThai
araArabic
ruRussian
ptPortuguese
deGerman
itItalian
elGreek language
nlDutch
plPolish
bulBulgarian
estEstonian
danDanish
finFinnish
csCzech
romRomanian
sloSlovenia
sweSwedish
huHungarian
chtTraditional Chinese
vieVietnamese

AFTERWORD

If this repo helped you, give me a star and it's the greatest encouragement to me.

0.4.0

4 years ago