mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 00:23:45 +08:00
feat(cmd): service return message i18 language support
This commit is contained in:
parent
f6c0f144a6
commit
492a5a6de7
@ -1,17 +1,20 @@
|
||||
use super::CmdResult;
|
||||
use crate::core::{service, CoreManager};
|
||||
use crate::{
|
||||
core::{service, CoreManager},
|
||||
utils::i18n::t,
|
||||
};
|
||||
|
||||
async fn execute_service_operation(
|
||||
service_op: impl std::future::Future<Output = Result<(), impl ToString + std::fmt::Debug>>,
|
||||
op_type: &str,
|
||||
) -> CmdResult {
|
||||
if service_op.await.is_err() {
|
||||
let emsg = format!("{} {} failed", op_type, "service");
|
||||
return Err(emsg);
|
||||
let emsg = format!("{} {} failed", op_type, "Service");
|
||||
return Err(t(emsg.as_str()));
|
||||
}
|
||||
if CoreManager::global().restart_core().await.is_err() {
|
||||
let emsg = format!("{} {} failed", op_type, "core");
|
||||
return Err(emsg);
|
||||
let emsg = format!("{} {} failed", "Restart", "Core");
|
||||
return Err(t(emsg.as_str()));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -201,6 +201,8 @@
|
||||
"Tun Mode": "Tun Mode",
|
||||
"TUN requires Service Mode": "TUN mode requires install service",
|
||||
"Install Service": "Install Service",
|
||||
"Install Service failed": "Install Service failed",
|
||||
"Restart Core failed": "Restart Core failed",
|
||||
"Reset to Default": "Reset to Default",
|
||||
"Tun Mode Info": "Tun (Virtual NIC) mode: Captures all system traffic, when enabled, there is no need to enable system proxy.",
|
||||
"System Proxy Enabled": "System proxy is enabled, your applications will access the network through the proxy",
|
||||
|
@ -201,6 +201,8 @@
|
||||
"Tun Mode": "虚拟网卡模式",
|
||||
"TUN requires Service Mode": "TUN 模式需要安装服务",
|
||||
"Install Service": "安装服务",
|
||||
"Install Service failed": "安装服务失败",
|
||||
"Restart Core failed": "重启核心失败",
|
||||
"Reset to Default": "重置为默认值",
|
||||
"Tun Mode Info": "TUN(虚拟网卡)模式接管系统所有流量,启用时无须打开系统代理",
|
||||
"System Proxy Enabled": "系统代理已启用,您的应用将通过代理访问网络",
|
||||
|
Loading…
x
Reference in New Issue
Block a user