all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable
@ 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 ` [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable Maximiliano Sandoval
  0 siblings, 2 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-01-27  9:31 UTC (permalink / raw)
  To: yew-devel

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"))
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [yew-devel] [PATCH proxmox-yew-comp 2/2] tasks: Replace "Until:" with "Until"
  2025-01-27  9:31 [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable Maximiliano Sandoval
@ 2025-01-27  9:31 ` Maximiliano Sandoval
  2025-02-10 14:11 ` [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable Maximiliano Sandoval
  1 sibling, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-01-27  9:31 UTC (permalink / raw)
  To: yew-devel

So it is consistent with the "Since" string above.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 src/tasks.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tasks.rs b/src/tasks.rs
index 1b65c8e..3d93733 100644
--- a/src/tasks.rs
+++ b/src/tasks.rs
@@ -368,7 +368,7 @@ impl LoadableComponent for ProxmoxTasks {
             )
 
             // second row
-            .with_child(html!{<div>{tr!("Until:")}</div>})
+            .with_child(html!{<div>{tr!("Until")}</div>})
             .with_child(
                 Field::new()
                     .name("until")
-- 
2.39.5



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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable
  2025-01-27  9:31 [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable 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
  2025-02-18 13:35   ` Maximiliano Sandoval
  1 sibling, 1 reply; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-02-10 14:11 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: yew-devel


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable
  2025-02-10 14:11 ` [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable Maximiliano Sandoval
@ 2025-02-18 13:35   ` Maximiliano Sandoval
  0 siblings, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-02-18 13:35 UTC (permalink / raw)
  To: Maximiliano Sandoval; +Cc: yew-devel


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-18 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-27  9:31 [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable 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 ` [yew-devel] [PATCH proxmox-yew-comp 1/2] mark missing strings as translatable Maximiliano Sandoval
2025-02-18 13:35   ` Maximiliano Sandoval

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