From f421a14659be72a5c639fbb5a3ff46607416fb56 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 21 Mar 2024 11:18:48 +0800 Subject: [PATCH] fix lang --- src/lang.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/lang.rs b/src/lang.rs index d9daaed42..25768a0c3 100644 --- a/src/lang.rs +++ b/src/lang.rs @@ -15,6 +15,7 @@ mod es; mod et; mod fa; mod fr; +mod he; mod hu; mod id; mod it; @@ -39,7 +40,6 @@ mod tr; mod tw; mod ua; mod vn; -mod he; pub const LANGS: &[(&str, &str)] = &[ ("en", "English"), @@ -161,23 +161,27 @@ pub fn translate_locale(name: String, locale: &str) -> String { s = s.replace("{}", &value); } if !crate::is_rustdesk() { - if s.contains("RustDesk") && !name.starts_with("upgrade_rustdesk_server_pro") && name != "powered_by_me" { + if s.contains("RustDesk") + && !name.starts_with("upgrade_rustdesk_server_pro") + && name != "powered_by_me" + { s = s.replace("RustDesk", &crate::get_app_name()); } } s }; if let Some(v) = m.get(&name as &str) { - if v.is_empty() { - if lang != "en" { - if let Some(v) = en::T.get(&name as &str) { - return replace(v); - } - } - } else { + if !v.is_empty() { return replace(v); } } + if lang != "en" { + if let Some(v) = en::T.get(&name as &str) { + if !v.is_empty() { + return replace(v); + } + } + } replace(&name.as_str()) }