https://github.com/edgetranslate/unified-translators
Collection of translators with unified interface.
https://github.com/edgetranslate/unified-translators
Last synced: about 1 year ago
JSON representation
Collection of translators with unified interface.
- Host: GitHub
- URL: https://github.com/edgetranslate/unified-translators
- Owner: EdgeTranslate
- License: mit
- Created: 2020-09-20T08:56:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-20T14:56:07.000Z (almost 6 years ago)
- Last Synced: 2025-04-19T06:25:14.791Z (about 1 year ago)
- Language: JavaScript
- Size: 145 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unified Translators
This is a collection of translators used in Edge Translate. We open source these translators separately
for people who want to build their own translator apps.
### Usage
```javascript
import { TRANSLATORS } from "unified-translators";
// Using Hybrid translate.
TRANSLATORS.hybrid.translate("hello", "en", "zh-CN").then(result => {
console.log(result.mainMeaning);
});
// Using Bing translate.
TRANSLATORS.bing.translate("hello", "en", "zh-CN").then(result => {
console.log(result.mainMeaning);
});
// Using Google translate.
TRANSLATORS.google.translate("hello", "en", "zh-CN").then(result => {
console.log(result.mainMeaning);
});
```
### Supported
* Hybrid Translate
Combine translations from different translators.
* Google Translate
Translations from [Google Translate](https://translate.google.cn).
* Bing Translate
Translations from [Bing Translate](https://cn.bing.com/translator).
### To Be Done
* Baidu Translate (supported in Edge Translate)
* Tencent Translate (supported in Edge Translate)
* Youdao Translate
### More Info
Please refer to [tests](./test/).