Git Product home page Git Product logo

lingual's Introduction

Lingual

Provides google translation api for Rust.

Example

The crate uses reqwest to make http calls and by default uses async/await syntax. Support for wasm is included and will be enabled implicitly if when the target_arch is wasm32.

use lingual::{translate, Langs, Translator}
let translator = Translator::default();
let translation = translator.translate("Hello World", Lang::Auto, Langs::Es).await.unwrap();
assert_eq!("Hola Mundo", translation.text());

If you prefer to use regular sync version, simply include blocking feature in your Cargo.toml file. It will be the same code as above with the exception of await keyword.

lingual = {version = "...", features = ["blocking"]}

Features

  • blocking - uses blocking/sync api for fetching the translations.

Roadmap

  • Support for async/await syntax
  • Support for blocking api
  • Support for wasm
  • [] Support for DeepL api (Will be worked on later)
    • [] blocking
    • [] async/await

lingual's People

Contributors

deepp0925 avatar squidtoon99 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

squidtoon99

lingual's Issues

Issues with reqwest::client::get - https

const BASE_URL: &str = "http://translate.googleapis.com";

works but

const BASE_URL: &str = "http://translate.googleapis.com";

results in Invalid URL (https, expected http)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.