This commit is contained in:
Aitzol 2024-06-07 17:09:23 +02:00
parent 7945e48b79
commit 17f7a9df7b

View File

@ -32,18 +32,6 @@ impl Project {
}
fn main() {
/*
let default = String::from("en_US"); // default locale
let locales = rust_i18n::available_locales!(); // available locales
let lang:String = match env::var("LANG") { // find out user's lang
Ok(val) => match val {
v if !v.is_empty() && locales.iter().any(|e| v.contains(e)) => v[..5].to_string(),
_ => default
} ,
Err(..) => default,
};
rust_i18n::set_locale(&lang); // set user lang
*/
let _ = set_lang();
let mut wiki_path = String::new();
let mut doc_path = String::new();
@ -69,14 +57,12 @@ fn main() {
if !Path::new(&wiki_path).exists(){
let mut ans = String::new();
//println!("{} dokumentuentzako kokapen berria sortu nahi duzu?(y/n)[Y]", &project_dir.trim().to_owned().green().bold());
println!("{}", t!("Do you want to create a new location called %{s} for the documents?(y/n)[Y]", s = &project_dir.trim().to_owned().green().bold()));
io::stdin().read_line(&mut ans).expect("Failed to read line");
if ans.trim().is_empty() { ans = String::from("Y") };
match ans.trim() {
"y" | "yes" | "Y" | "B" | "Bai" => { //let _ = fs::create_dir(&wiki_path);
let _ = mkdir(&wiki_path);
//println!("{} kokapena sortu da.", &project_dir.trim().to_owned().green().bold());
println!("{}.", t!("Location %{s} has been created", s = &project_dir.trim().to_owned().green().bold()));
},
_ => continue,
@ -137,8 +123,6 @@ fn main() {
};
}
}
//println!("{} proiektua sortu da. Orain index.md fitxategia editatu eta edukiak \
// sor ditzakezu", &input.trim().to_owned().green().bold());
println!("{}.", t!("Project %{s} has been created. Now you can edit index.md file and create content", s = &input.trim().to_owned().green().bold()));
},
_ => continue,