Skip to content
/ ytr Public

Yandex.Translate API wrapper for Rust

License

Notifications You must be signed in to change notification settings

jvstme/ytr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ytr

Yandex.Translate API wrapper for Rust

Usage example

let key = String::from("my-api-key");
let api = ytr::ApiClient::new(key);

let result = api.translate("Hello!", "ru")   // required parameters
    .format("plain")                         // optional parameter
    .get();                                  // execute the request
 
match result {
    Ok(response) => {
        println!("{}", response.text);       // prints "Привет!"
        println!("{}", response.lang);       // prints "en-ru"
    },
     
    Err(error) => {
        eprintln!(
            "An error has occurred: {:?}",
            error
        );
    },
};

License

Licensed under MIT license

Contribution

You are free to propose changes and contribute. Any input is welcome =)

About

Yandex.Translate API wrapper for Rust

Resources

License

Stars

Watchers

Forks

Languages