Skip to content

Commit

Permalink
0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
grantshandy committed Mar 25, 2021
1 parent 6a0775e commit 35524a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libretranslate"
version = "0.2.6"
version = "0.2.7"
authors = ["Grant Handy <[email protected]>", "Rafael G. Dantas <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ A LibreTranslate API client for Rust.
[![Crate](https://img.shields.io/crates/v/libretranslate.svg)](https://crates.io/crates/libretranslate)
[![API](https://docs.rs/libretranslate/badge.svg)](https://docs.rs/libretranslate)
```
libretranslate = "0.2.6"
libretranslate = "0.2.7"
```

`libretranslate` allows you to use open source machine translation in your projects through an easy to use API that connects to the official [webpage](https://libretranslate.com/).

## Basic Example
`libretranslate` is an async library, so you'll have to use an async runtime like [`tokio`](https://crates.io/crates/tokio) or [`async-std`](https://crates.io/crates/async-std).

All translations are done through the `translate()` function:
All translations are done through the `translate` function:
```rust
use libretranslate::{translate, Language};

fn main() {
#[tokio::main]
async fn main() {
let source = Language::French;
let target = Language::English;
let input = "le texte français.";
let input = "Le texte français.";

let data = translate(Some(source), target, input).unwrap();
let data = translate(Some(source), target, input).await.unwrap();

println!("Input {}: {}", data.source.as_pretty(), data.input);
println!("Output {}: {}", data.target.as_pretty(), data.output);
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! # libretranslate-rs
//! A LibreTranslate API client for Rust.
//! ```
//! libretranslate = "0.2.6"
//! libretranslate = "0.2.7"
//! ```
//!
//! `libretranslate` allows you to use open source machine translation in your projects through an easy to use API that connects to the official [webpage](https://libretranslate.com/).
//!
//! ## Basic Example
//! `libretranslate` is an async library, so you'll have to use an async runtime like [`tokio`](https://crates.io/crates/tokio) or [`async-std`](https://crates.io/crates/async-std).
//!
//! All translations are done through the `translate()` function:
//! All translations are done through the [`translate`](crate::translate) function:
//! ```rust
//! use libretranslate::{translate, Language};
//!
Expand Down

0 comments on commit 35524a1

Please sign in to comment.