lingual

Crates.iolingual
lib.rslingual
version1.1.0
sourcesrc
created_at2023-07-06 00:08:01.435712
updated_at2024-01-27 03:06:50.376931
descriptionFree and Unlimited Language Translation (Google) API for Rust. Supports Async and Sync.
homepagehttps://github.com/deepp0925/lingual
repositoryhttps://github.com/deepp0925/lingual
max_upload_size
id909467
size32,013
Deep Patel (Deepp0925)

documentation

https://docs.rs/lingual

README

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
Commit count: 32

cargo fmt