lingual 1.0.2

Free and Unlimited Language Translation (Google) API for Rust. Supports Async and Sync.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use lingual::*;

#[cfg(feature = "non-blocking")]
#[tokio::test]
async fn test_translate() {
    let translation = non_blocking::translate("Hello World", None, Some(Lang::Es))
        .await
        .unwrap();
    assert_eq!("Hola Mundo", translation.text());
}

#[cfg(feature = "blocking")]
#[test]
fn test_translate_blocking() {
    let translation = blocking::translate("Hello World", None, Some(Lang::Es)).unwrap();
    assert_eq!("Hola Mundo", translation.text());
}