From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Maximiliano Sandoval <m.sandoval@proxmox.com>
Cc: yew-devel@lists.proxmox.com
Subject: Re: [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable
Date: Mon, 10 Feb 2025 15:11:33 +0100 [thread overview]
Message-ID: <s8owmdxj3du.fsf@proxmox.com> (raw)
In-Reply-To: <20250127093159.123143-1-m.sandoval@proxmox.com>
Maximiliano Sandoval <m.sandoval@proxmox.com> writes:
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
> 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<Vec<DataTableHeader<BasicRealmInfo>>> = 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"))
ping.
_______________________________________________
yew-devel mailing list
yew-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel
next prev parent reply other threads:[~2025-02-10 14:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 9:31 Maximiliano Sandoval
2025-01-27 9:31 ` [yew-devel] [PATCH proxmox-yew-comp 2/2] tasks: Replace "Until:" with "Until" Maximiliano Sandoval
2025-02-10 14:11 ` Maximiliano Sandoval [this message]
2025-02-18 13:35 ` [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable Maximiliano Sandoval
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=s8owmdxj3du.fsf@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox