From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 52E131FF13B for ; Wed, 03 Jun 2026 10:00:53 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 67A8ADD3; Wed, 3 Jun 2026 10:00:52 +0200 (CEST) From: Maximiliano Sandoval To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox-datacenter-manager] overview: make ha-state non-translatable Date: Wed, 3 Jun 2026 10:00:17 +0200 Message-ID: <20260603080018.131249-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780473582423 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.127 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [overview.rs] Message-ID-Hash: TKUBKZUDOAUSQJVW2ELT3JAFBUZCZYQU X-Message-ID-Hash: TKUBKZUDOAUSQJVW2ELT3JAFBUZCZYQU X-MailFrom: m.sandoval@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: There is no point in translating "{0}". We additionally replace the "none" string with "None", since there isn't any HA state called "none". The capitalization makes it clear that there is no state rather than being in a state called "none". Signed-off-by: Maximiliano Sandoval --- ui/src/pve/lxc/overview.rs | 9 ++++----- ui/src/pve/qemu/overview.rs | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/ui/src/pve/lxc/overview.rs b/ui/src/pve/lxc/overview.rs index 18d28229..e8e46516 100644 --- a/ui/src/pve/lxc/overview.rs +++ b/ui/src/pve/lxc/overview.rs @@ -268,14 +268,13 @@ impl yew::Component for LxcanelComp { } let ha_text = if status.ha["managed"].as_i64().unwrap_or_default() > 0 { - let ha_state = status + status .ha .get("state") - .and_then(|c| c.as_str()) - .unwrap_or_default(); - tr!("{0}", ha_state) + .map(|c| c.to_string()) + .unwrap_or_default() } else { - tr!("none") + tr!("None") }; status_comp.add_child(status_row(tr!("HA state"), "fa-heartbeat", ha_text)); diff --git a/ui/src/pve/qemu/overview.rs b/ui/src/pve/qemu/overview.rs index f14f9744..123cc519 100644 --- a/ui/src/pve/qemu/overview.rs +++ b/ui/src/pve/qemu/overview.rs @@ -277,14 +277,13 @@ impl yew::Component for QemuOverviewPanelComp { } let ha_text = if status.ha["managed"].as_i64().unwrap_or_default() > 0 { - let ha_state = status + status .ha .get("state") - .and_then(|c| c.as_str()) - .unwrap_or_default(); - tr!("{0}", ha_state) + .map(|c| c.to_string()) + .unwrap_or_default() } else { - tr!("none") + tr!("None") }; status_comp.add_child(status_row(tr!("HA state"), "fa-heartbeat", ha_text)); -- 2.47.3