change default language
This commit is contained in:
+2
-2
@@ -7,14 +7,14 @@ args:
|
||||
short: s
|
||||
long: source
|
||||
value_name: source_lang
|
||||
help: The language you want to translate. Default is EN_US
|
||||
help: The language you want to translate. Default is DE
|
||||
takes_value: true
|
||||
required: false
|
||||
- target:
|
||||
short: t
|
||||
long: target
|
||||
value_name: target_lang
|
||||
help: The language your text should be tranlated to. Default is DE
|
||||
help: The language your text should be tranlated to. Default is EN-US
|
||||
takes_value: true
|
||||
required: false
|
||||
- file:
|
||||
|
||||
+3
-3
@@ -26,17 +26,17 @@ pub mod deepl_helper {
|
||||
let my_path = base_dir.config_dir().join("deepl/.env");
|
||||
match dotenv::from_path(my_path.as_path()) {
|
||||
Ok(env) => env,
|
||||
Err(_) => panic!("could not load .env file {:?}", my_path.as_path()),
|
||||
Err(_) => panic!("Could not load .env file {:?}", my_path.as_path()),
|
||||
};
|
||||
|
||||
let yaml = load_yaml!("cli.yml");
|
||||
let matches = App::from_yaml(yaml).get_matches();
|
||||
|
||||
Self {
|
||||
source_lang: matches.value_of("source").unwrap_or("EN").to_string(),
|
||||
source_lang: matches.value_of("source").unwrap_or("DE").to_string(),
|
||||
target_lang: matches
|
||||
.value_of("target")
|
||||
.unwrap_or("DE")
|
||||
.unwrap_or("EN-US")
|
||||
.to_string(),
|
||||
file: matches.value_of("file").unwrap_or_default().to_string(),
|
||||
key: env::var("key").unwrap(),
|
||||
|
||||
Reference in New Issue
Block a user