From: Maximiliano Sandoval <m.sandoval@proxmox.com>
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 [thread overview]
Message-ID: <20260603080018.131249-1-m.sandoval@proxmox.com> (raw)
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 <m.sandoval@proxmox.com>
---
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
reply other threads:[~2026-06-03 8:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260603080018.131249-1-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox