translate rustdesk
This commit is contained in:
		
							parent
							
								
									a28c9f8f36
								
							
						
					
					
						commit
						4c8c2aa323
					
				| @ -984,6 +984,11 @@ pub fn get_app_name() -> String { | ||||
|     hbb_common::config::APP_NAME.read().unwrap().clone() | ||||
| } | ||||
| 
 | ||||
| #[inline] | ||||
| pub fn is_rustdesk() -> bool { | ||||
|     hbb_common::config::APP_NAME.read().unwrap().eq("RustDesk") | ||||
| } | ||||
| 
 | ||||
| #[inline] | ||||
| pub fn get_uri_prefix() -> String { | ||||
|     format!("{}://", get_app_name().to_lowercase()) | ||||
|  | ||||
| @ -156,6 +156,11 @@ pub fn translate_locale(name: String, locale: &str) -> String { | ||||
|         if let Some(value) = placeholder_value.as_ref() { | ||||
|             s = s.replace("{}", &value); | ||||
|         } | ||||
|         if !crate::is_rustdesk() { | ||||
|             if s.contains("RustDesk") && !name.starts_with("upgrade_rustdesk_server_pro") { | ||||
|                 s = s.replace("RustDesk", &crate::get_app_name()); | ||||
|             } | ||||
|         } | ||||
|         s | ||||
|     }; | ||||
|     if let Some(v) = m.get(&name as &str) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user