From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yew-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id 94D651FF168
	for <inbox@lore.proxmox.com>; Tue, 18 Feb 2025 14:35:16 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id B9F09D49F;
	Tue, 18 Feb 2025 14:35:13 +0100 (CET)
References: <20250127093159.123143-1-m.sandoval@proxmox.com>
 <s8owmdxj3du.fsf@proxmox.com>
User-agent: mu4e 1.10.8; emacs 29.4
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Maximiliano Sandoval <m.sandoval@proxmox.com>
Date: Tue, 18 Feb 2025 14:35:02 +0100
In-reply-to: <s8owmdxj3du.fsf@proxmox.com>
Message-ID: <s8owmdnqstt.fsf@proxmox.com>
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.101 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
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
Subject: Re: [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 <yew-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/yew-devel>, 
 <mailto:yew-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/yew-devel/>
List-Post: <mailto:yew-devel@lists.proxmox.com>
List-Help: <mailto:yew-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel>, 
 <mailto:yew-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Yew framework devel list at Proxmox <yew-devel@lists.proxmox.com>
Cc: yew-devel@lists.proxmox.com
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: yew-devel-bounces@lists.proxmox.com
Sender: "yew-devel" <yew-devel-bounces@lists.proxmox.com>


Maximiliano Sandoval <m.sandoval@proxmox.com> writes:

> 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.

ping.


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