chore: translate CLI and installer messages to English

This commit is contained in:
2026-02-18 21:04:28 +08:00
parent d1e23a3179
commit 95324ce199
16 changed files with 219 additions and 249 deletions

View File

@@ -1,6 +1,7 @@
use std::io;
use std::path::PathBuf;
#[allow(dead_code)]
pub fn check_dir(dir: Option<&str>) -> io::Result<Vec<String>> {
let path: PathBuf = match dir {
None | Some(".") | Some("./") => std::env::current_dir()?,

View File

@@ -1,30 +1,24 @@
use crate::utils::text::{BOLD, BRIGHT_GREEN, BRIGHT_RED, BRIGHT_YELLOW, colored};
use crate::utils::text::{BOLD_CYAN, colored};
#[allow(dead_code)]
pub fn error(msg: &str) {
println!(
"{}: {msg}",
colored("error", &(BRIGHT_RED.to_owned() + BOLD))
);
println!("{}: {msg}", colored("error", BOLD_CYAN),);
}
#[allow(dead_code)]
pub fn warn(msg: &str) {
println!(
"{}: {msg}",
colored("warn", &(BRIGHT_YELLOW.to_owned() + BOLD))
);
println!("{}: {msg}", colored("warn", BOLD_CYAN),);
}
#[allow(dead_code)]
pub fn info(msg: &str) {
println!("{}: {msg}", colored("info", BOLD));
}
#[allow(dead_code)]
pub fn ok(msg: &str) {
println!(
"{}: {msg}",
colored("ok", &(BRIGHT_GREEN.to_owned() + BOLD))
);
}
// #[allow(dead_code)]
// pub fn info(msg: &str) {
// println!("{}: {msg}", colored("info", BOLD));
// }
//
// #[allow(dead_code)]
// pub fn ok(msg: &str) {
// println!(
// "{}: {msg}",
// colored("ok", &(BRIGHT_GREEN.to_owned() + BOLD))
// );
// }

View File

@@ -1,16 +1,32 @@
#[allow(dead_code)]
pub const RESET: &str = "\x1b[0m";
#[allow(dead_code)]
pub const BOLD: &str = "\x1b[1m";
#[allow(dead_code)]
pub const BRIGHT_RED: &str = "\x1b[91m";
#[allow(dead_code)]
pub const BRIGHT_GREEN: &str = "\x1b[92m";
#[allow(dead_code)]
pub const BRIGHT_YELLOW: &str = "\x1b[93m";
#[allow(dead_code)]
pub const BRIGHT_CYAN: &str = "\x1b[96m";
#[allow(dead_code)]
pub const BOLD_RED: &str = "\x1b[1m\x1b[91m";
#[allow(dead_code)]
pub const BOLD_GREEN: &str = "\x1b[1m\x1b[92m";
#[allow(dead_code)]
pub const BOLD_YELLOW: &str = "\x1b[1m\x1b[93m";
#[allow(dead_code)]
pub const BOLD_CYAN: &str = "\x1b[1m\x1b[96m";
#[allow(dead_code)]
pub fn colored(msg: &str, style: &str) -> String {
format!("{style}{msg}{RESET}")
}
#[allow(dead_code)]
pub fn printc(msg: &str, style: &str) {
println!("{style}{msg}{RESET}");
}