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,16 +1,16 @@
use crate::cli::build::build;
use crate::config::{PROFILE, flags};
use crate::utils::fs::check_dir;
use crate::utils::text::{BOLD, BRIGHT_RED, colored};
use crate::utils::log::{error, warn};
use crate::utils::text::{BOLD_GREEN, colored};
use std::process::Command;
pub fn run(args: &[String]) -> i32 {
let red_bold = BRIGHT_RED.to_owned() + BOLD;
let mut active_profile = PROFILE.to_string();
let items = check_dir(None).unwrap_or_default();
if !items.contains(&"dcr.toml".to_string()) {
println!("{}: не найден файл dcr.toml", colored("error", &red_bold));
error("dcr.toml file not found");
return 1;
}
@@ -20,18 +20,21 @@ pub fn run(args: &[String]) -> i32 {
if flags(candidate).is_some() {
active_profile = candidate.to_string();
} else {
println!("{}: неизвестный флаг сборки", colored("error", &red_bold));
warn("Unknown build flag");
return 1;
}
} else {
println!("{}: неизвестный аргумент", colored("error", &red_bold));
warn("Unknown argument");
return 1;
}
}
let build_status = build(args);
if build_status == 0 {
println!("\n Запуск target/{active_profile}/main");
println!(
"\n {} target/{active_profile}/main",
colored("Running", BOLD_GREEN)
);
println!("--------------------------------");
return Command::new(format!("./target/{active_profile}/main"))
.status()
@@ -43,13 +46,13 @@ pub fn run(args: &[String]) -> i32 {
.unwrap_or_default()
.contains(&active_profile)
{
println!("Запуск последнего релиза");
warn("Launch of the latest release");
return Command::new(format!("./target/{active_profile}/main"))
.status()
.map(|status| status.code().unwrap_or(1))
.unwrap_or(1);
}
println!("Исправьте ошибки в коде для запуска проекта");
error("Fix errors in the code to run the project");
0
}