locales: introduce Internationalization / Locales

* using crate locales

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2019-10-31 00:58:00 +01:00
parent d5f58f2576
commit 0a9fdbab2a
3 changed files with 29 additions and 2 deletions

View File

@@ -1,12 +1,21 @@
#[macro_use]
extern crate clap;
extern crate locales;
use clap::App;
use locales::t;
fn main() {
println!("Parsing arguments ...");
// set locale
let lang= "de";
// handle commandline arguments with clap (relative path to cli.yml)
let res = t!("parse.arguments", lang);
println!("{}", &res);
let yaml = load_yaml!("cli.yml");
let _matches = App::from_yaml(yaml).get_matches();
println!("Starting program logic ...");
let res = t!("main.start", lang);
println!("{}", &res);
}