Skip to content

Commit

Permalink
add: source google browser translate v2 (GoogleBrowserTranslateV2)
Browse files Browse the repository at this point in the history
add: source watson (WatsonDetect, WatsonTranslator)
  • Loading branch information
BANKA2017 committed Apr 6, 2024
1 parent 9a1478e commit 2d538dc
Show file tree
Hide file tree
Showing 12 changed files with 665 additions and 21 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ This is an early release version, everything are subject to change, please **DO

## Predict (Nodejs/Deno)

`baidu` / `yandex` / `microsoft`
`baidu` / `yandex` / `microsoft` / `watson`

```javascript
import { BaiduLanguagePredict, YandexDetect, MicrosoftBrowserPredict } from '@kdwnil/translator-utils'
import { BaiduLanguagePredict, YandexDetect, MicrosoftBrowserPredict, WatsonDetect } from '@kdwnil/translator-utils'

await BaiduLanguagePredict('hello') // en
await BaiduLanguagePredict('你好') // zh
Expand Down Expand Up @@ -108,6 +108,8 @@ Because of `CORS policy`, you can only use `GoogleBrowserTranslate`, `MicrosoftB

`YandexBrowserTranslate` is supported in browser, but predicted service is **NOT** supported, so you can't set `source` to `auto` in function calling.

`GoogleBrowserTranslateV2` is also supported in browser, but the source can not be set to `auto`.

## Nodejs

**Proxy** can only be used in nodejs environment, set environment variable `http_proxy` and `https_proxy` to active it
Expand Down
Loading

0 comments on commit 2d538dc

Please sign in to comment.