Skip to content

EdgeTranslate/unified-translators

Repository files navigation

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

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.

  • Bing Translate

    Translations from Bing Translate.

To Be Done

  • Baidu Translate (supported in Edge Translate)

  • Tencent Translate (supported in Edge Translate)

  • Youdao Translate

More Info

Please refer to tests.

About

Collection of translators with unified interface.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published