all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-datacenter-manager] overview: make ha-state non-translatable
@ 2026-06-03  8:00 Maximiliano Sandoval
  2026-06-19  7:33 ` applied: " Lukas Wagner
  0 siblings, 1 reply; 2+ messages in thread
From: Maximiliano Sandoval @ 2026-06-03  8:00 UTC (permalink / raw)
  To: pdm-devel

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





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* applied: [PATCH proxmox-datacenter-manager] overview: make ha-state non-translatable
  2026-06-03  8:00 [PATCH proxmox-datacenter-manager] overview: make ha-state non-translatable Maximiliano Sandoval
@ 2026-06-19  7:33 ` Lukas Wagner
  0 siblings, 0 replies; 2+ messages in thread
From: Lukas Wagner @ 2026-06-19  7:33 UTC (permalink / raw)
  To: pdm-devel, Maximiliano Sandoval


On Wed, 03 Jun 2026 10:00:17 +0200, Maximiliano Sandoval wrote:
> 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".
> 
> 
> [...]

Applied, thanks!

Changed the commit subject to make it a bit more clear. Also, as discussed in
person, I dropped the part changing the captitalization of 'none'. I don't think
that capitalization is a good distinction to have between a state enum value and
no state. Also, for the user the distinction does not really matter here, so I
left it as is to leave it more consistent.

[1/1] ui: guest overview: ha-state: don't translate string containing only a variable
      commit: 390f101fb0f3dd9ce89743ee930f63df82009bc6

Best regards,
-- 
Lukas Wagner <l.wagner@proxmox.com>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-06-19  7:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03  8:00 [PATCH proxmox-datacenter-manager] overview: make ha-state non-translatable Maximiliano Sandoval
2026-06-19  7:33 ` applied: " Lukas Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal