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 082801FF173 for ; Mon, 27 Jan 2025 10:32:03 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4B0E91D956; Mon, 27 Jan 2025 10:32:02 +0100 (CET) From: Maximiliano Sandoval To: yew-devel@lists.proxmox.com Date: Mon, 27 Jan 2025 10:31:58 +0100 Message-Id: <20250127093159.123143-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.106 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing 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/realm_selector.rs | 5 +++-- src/task_viewer.rs | 7 +++++-- src/tfa/tfa_dialog.rs | 21 +++++++++++++-------- src/tfa/tfa_view.rs | 2 +- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/realm_selector.rs b/src/realm_selector.rs index 6522c59..0734574 100644 --- a/src/realm_selector.rs +++ b/src/realm_selector.rs @@ -6,6 +6,7 @@ use yew::prelude::*; use pwt::props::RenderFn; use pwt::state::Store; +use pwt::tr; use pwt::widget::data_table::{DataTable, DataTableColumn, DataTableHeader}; use pwt::widget::form::{Selector, SelectorRenderArgs, ValidateFn}; use pwt::widget::GridPicker; @@ -14,14 +15,14 @@ use crate::common_api_types::BasicRealmInfo; thread_local! { static COLUMNS: Rc>> = Rc::new(vec![ - DataTableColumn::new("Realm") + DataTableColumn::new(tr!("Realm")) .width("100px") .show_menu(false) .render(|record: &BasicRealmInfo| { html!{record.realm.clone()} }) .into(), - DataTableColumn::new("Comment") + DataTableColumn::new(tr!("Comment")) .width("300px") .show_menu(false) .render(|record: &BasicRealmInfo| { diff --git a/src/task_viewer.rs b/src/task_viewer.rs index 85958e8..0fbfeac 100644 --- a/src/task_viewer.rs +++ b/src/task_viewer.rs @@ -159,9 +159,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()), ) }); diff --git a/src/tfa/tfa_dialog.rs b/src/tfa/tfa_dialog.rs index ec84ff8..c23c568 100644 --- a/src/tfa/tfa_dialog.rs +++ b/src/tfa/tfa_dialog.rs @@ -183,25 +183,30 @@ impl Component for ProxmoxTfaDialog { let mut panel = TabPanel::new().class("pwt-flex-fill"); if props.challenge.challenge.totp { - panel.add_item_builder(TabBarItem::new().key("totp").label("TOTP App"), { + // TRANSLATORS: TOTP means time-based one-time password + panel.add_item_builder(TabBarItem::new().key("totp").label(tr!("TOTP App")), { let on_totp = props.on_totp.clone(); move |_| render_totp(on_totp.clone()) }); } if props.challenge.challenge.yubico { - panel.add_item_builder(TabBarItem::new().key("yubico").label("Yubico OTP"), { + // TRANSLATORS: Yubico is a company name. OTP means one-time password + panel.add_item_builder(TabBarItem::new().key("yubico").label(tr!("Yubico OTP")), { let on_yubico = props.on_yubico.clone(); move |_| render_yubico(on_yubico.clone()) }); } if props.challenge.challenge.recovery.is_available() { - panel.add_item_builder(TabBarItem::new().key("recovery").label("Recovery Key"), { - let on_recovery = props.on_recovery.clone(); - let available_keys = props.challenge.challenge.recovery.0.clone(); - move |_| render_recovery(on_recovery.clone(), &available_keys) - }); + panel.add_item_builder( + TabBarItem::new().key("recovery").label(tr!("Recovery Key")), + { + let on_recovery = props.on_recovery.clone(); + let available_keys = props.challenge.challenge.recovery.0.clone(); + move |_| render_recovery(on_recovery.clone(), &available_keys) + }, + ); } /* @@ -219,7 +224,7 @@ impl Component for ProxmoxTfaDialog { } */ if let Some((challenge, challenge_string)) = self.webauthn_challenge.clone() { - panel.add_item_builder(TabBarItem::new().key("webauthn").label("WebAuthN"), { + panel.add_item_builder(TabBarItem::new().key("webauthn").label(tr!("WebAuthn")), { let on_webauthn = props.on_webauthn.clone(); move |info: &SelectionViewRenderInfo| { WebAuthn::new() diff --git a/src/tfa/tfa_view.rs b/src/tfa/tfa_view.rs index 45f7a66..c4c1a43 100644 --- a/src/tfa/tfa_view.rs +++ b/src/tfa/tfa_view.rs @@ -268,7 +268,7 @@ impl LoadableComponent for ProxmoxTfaView { .class("pwt-w-100") .class("pwt-overflow-hidden") .class("pwt-border-bottom") - .with_child(MenuButton::new("Add").show_arrow(true).menu(add_menu)) + .with_child(MenuButton::new(tr!("Add")).show_arrow(true).menu(add_menu)) .with_spacer() .with_child( Button::new(tr!("Edit")) -- 2.39.5 _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel