reword

Crates.io Docs

A fast and safe translation generator.

Examples

Add this to Cargo.toml:

toml [dependencies] reword = "0.1"

And this to main.rs:

```rust

[macro_use]

extern crate reword;

reword! { enum Lang { Hi { ENUK | ENUS = "Hi"; NO = "Hei"; } HowAreYou { ENUK = "How are you?"; ENUS = "How you doing?"; NO = "Hvordan går det?"; } } }

fn main() { let mut lang = Lang::NO; assert_eq!(lang.reword::(), "Hei");

lang = Lang::EN_UK;
assert_eq!(lang.reword::<HowAreYou>(), "How are you?");

lang = Lang::EN_US;
assert_eq!(lang.reword::<HowAreYou>(), "How you doing?");

} ```

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.