all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH proxmox-yew-comp] task viewer: mark user-facing strings as translatable
Date: Mon,  8 Sep 2025 14:38:19 +0200	[thread overview]
Message-ID: <20250908123821.407022-1-m.sandoval@proxmox.com> (raw)

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 src/task_viewer.rs | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/src/task_viewer.rs b/src/task_viewer.rs
index f1e2d5c..e78454e 100644
--- a/src/task_viewer.rs
+++ b/src/task_viewer.rs
@@ -147,9 +147,12 @@ impl Component for PwtTaskViewer {
         let panel = self.loader.render(|data| {
             TabPanel::new()
                 .class("pwt-flex-fit")
-                .with_item(TabBarItem::new().label("Output"), self.view_output(ctx))
                 .with_item(
-                    TabBarItem::new().label("Status"),
+                    TabBarItem::new().label(tr!("Output")),
+                    self.view_output(ctx),
+                )
+                .with_item(
+                    TabBarItem::new().label(tr!("Status")),
                     self.view_status(ctx, data.clone()),
                 )
         });
@@ -190,7 +193,7 @@ impl PwtTaskViewer {
         let link = ctx.link();
 
         let toolbar = Toolbar::new().with_child(
-            Button::new("Stop")
+            Button::new(tr!("Stop"))
                 .disabled(!active)
                 .onclick(link.callback(|_| Msg::StopTask)),
         );
@@ -199,7 +202,7 @@ impl PwtTaskViewer {
             .class("pwt-flex-fit")
             .data(data)
             .rows(Rc::new(vec![
-                KVGridRow::new("status", "Status")
+                KVGridRow::new("status", tr!("Status"))
                     .renderer(|_name, value, record| {
                         let value = match value.as_str() {
                             Some(s) => s,
@@ -212,8 +215,8 @@ impl PwtTaskViewer {
                         html! {{format!("{}: {}", value, status)}}
                     })
                     .placeholder("unknown"),
-                KVGridRow::new("type", "Task type").required(true),
-                KVGridRow::new("user", "User name")
+                KVGridRow::new("type", tr!("Task type")).required(true),
+                KVGridRow::new("user", tr!("User name"))
                     .renderer(|_name, value, record| {
                         let mut user = match value.as_str() {
                             Some(s) => s.to_owned(),
@@ -225,22 +228,22 @@ impl PwtTaskViewer {
                         html! {{user}}
                     })
                     .required(true),
-                KVGridRow::new("node", "Node").required(true),
-                KVGridRow::new("pid", "Process ID").required(true),
-                KVGridRow::new("task_id", "Task ID"),
-                KVGridRow::new("starttime", "Start Time")
+                KVGridRow::new("node", tr!("Node")).required(true),
+                KVGridRow::new("pid", tr!("Process ID")).required(true),
+                KVGridRow::new("task_id", tr!("Task ID")),
+                KVGridRow::new("starttime", tr!("Start Time"))
                     .renderer(|_name, value, _record| match value.as_i64() {
                         None => html! {"unknown (wrong format)"},
                         Some(epoch) => html! { {render_epoch(epoch)} },
                     })
                     .required(true),
-                KVGridRow::new("endtime", "End Time").renderer(|_name, value, _record| match value
-                    .as_i64()
-                {
-                    None => html! {"unknown (wrong format)"},
-                    Some(epoch) => html! { {render_epoch(epoch)} },
+                KVGridRow::new("endtime", tr!("End Time")).renderer(|_name, value, _record| {
+                    match value.as_i64() {
+                        None => html! {"unknown (wrong format)"},
+                        Some(epoch) => html! { {render_epoch(epoch)} },
+                    }
                 }),
-                KVGridRow::new("duration", "Duration")
+                KVGridRow::new("duration", tr!("Duration"))
                     .renderer(move |_name, _value, record| {
                         if let Some(starttime) = record["starttime"].as_i64() {
                             let duration = if let Some(endtime) = record["endtime"].as_i64() {
@@ -254,7 +257,7 @@ impl PwtTaskViewer {
                         html! {"-"}
                     })
                     .required(true),
-                KVGridRow::new("upid", "Unique task ID"),
+                KVGridRow::new("upid", tr!("Unique task ID")),
             ]));
 
         Column::new()
@@ -271,7 +274,7 @@ impl PwtTaskViewer {
         let link = ctx.link();
 
         let toolbar = Toolbar::new().class("pwt-border-bottom").with_child(
-            Button::new("Stop")
+            Button::new(tr!("Stop"))
                 .disabled(!active)
                 .onclick(link.callback(|_| Msg::StopTask)),
         );
-- 
2.47.3



_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel


                 reply	other threads:[~2025-09-08 12:38 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=20250908123821.407022-1-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=yew-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 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