mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
chore: Add Translation
This commit is contained in:
parent
f18d0ab923
commit
64a9079ce4
@ -107,6 +107,20 @@ impl Tray {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_part(app_handle: &AppHandle) -> Result<()> {
|
pub fn update_part(app_handle: &AppHandle) -> Result<()> {
|
||||||
|
let zh = { Config::verge().latest().language == Some("zh".into()) };
|
||||||
|
|
||||||
|
let version = app_handle.package_info().version.to_string();
|
||||||
|
|
||||||
|
macro_rules! t {
|
||||||
|
($en: expr, $zh: expr) => {
|
||||||
|
if zh {
|
||||||
|
$zh
|
||||||
|
} else {
|
||||||
|
$en
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
let mode = {
|
let mode = {
|
||||||
Config::clash()
|
Config::clash()
|
||||||
.latest()
|
.latest()
|
||||||
@ -145,10 +159,9 @@ impl Tray {
|
|||||||
|
|
||||||
#[cfg(not(target_os = "linux"))]
|
#[cfg(not(target_os = "linux"))]
|
||||||
let _ = tray.set_tooltip(&format!(
|
let _ = tray.set_tooltip(&format!(
|
||||||
"Clash Verge {}\nSystem Proxy: {}\nTun Mode: {}",
|
"Clash Verge {version}\n{}: {system_proxy}\n{}: {tun_mode}",
|
||||||
app_handle.package_info().version,
|
t!("System Proxy", "系统代理"),
|
||||||
system_proxy,
|
t!("TUN Mode", "Tun 模式")
|
||||||
tun_mode
|
|
||||||
));
|
));
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user