From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id A65131FF187 for ; Mon, 8 Sep 2025 14:38:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 10E2711EF0; Mon, 8 Sep 2025 14:38:55 +0200 (CEST) From: Maximiliano Sandoval To: yew-devel@lists.proxmox.com Date: Mon, 8 Sep 2025 14:38:19 +0200 Message-ID: <20250908123821.407022-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1757335079088 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.099 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [yew-devel] [PATCH proxmox-yew-comp] task viewer: mark user-facing strings as translatable X-BeenThere: yew-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Yew framework devel list at Proxmox List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Yew framework devel list at Proxmox Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" Signed-off-by: Maximiliano Sandoval --- 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