summary refs log tree commit diff
path: root/src/components/signin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/signin.rs')
-rw-r--r--src/components/signin.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/components/signin.rs b/src/components/signin.rs
index 08e850a..156686e 100644
--- a/src/components/signin.rs
+++ b/src/components/signin.rs
@@ -1,3 +1,4 @@
+use gettextrs::*;
 use std::cell::RefCell;
 
 use adw::prelude::*;
@@ -87,7 +88,7 @@ fn callback_handler(sender: AsyncComponentSender<SignIn>) -> impl Fn(&soup::Serv
                 msg.set_response(
                     Some("text/plain; charset=\"utf-8\""),
                     soup::MemoryUse::Static,
-                    "Thank you! This window can now be closed.".as_bytes()
+                    gettext("Thank you! This window can now be closed.").as_bytes()
                 );
                 msg.connect_finished(move |_| {
                     sender.input(Input::Callback(Ok(response.take().unwrap())));
@@ -206,12 +207,12 @@ impl AsyncComponent for SignIn {
 
                     gtk::Label {
                         add_css_class: "title-1",
-                        set_text: "Sign in",
+                        set_text: &gettext("Sign in"),
                         set_justify: gtk::Justification::Center,
                     },
 
                     gtk::Label {
-                        set_text: "Please sign in with your website to use Bowl.\nYour website needs to support IndieAuth and Micropub for this app to work.",
+                        set_text: &gettext("Please sign in with your website to use Bowl.\nYour website needs to support IndieAuth and Micropub for this app to work."),
                         set_wrap: true,
                         set_halign: gtk::Align::BaselineCenter,
                         set_valign: gtk::Align::BaselineCenter,
@@ -240,12 +241,12 @@ impl AsyncComponent for SignIn {
                             },
                             gtk::Label {
                                 #[watch]
-                                set_text: if model.busy_guard.is_some() {
-                                    "Talking to your website..."
+                                set_text: &if model.busy_guard.is_some() {
+                                    gettext("Talking to your website...")
                                 } else if model.callback_server.is_some() {
-                                    "Waiting for authorization..."
+                                    gettext("Waiting for authorization...")
                                 } else {
-                                    "Sign in"
+                                    gettext("Sign in")
                                 },
                             }
                         },
@@ -451,7 +452,7 @@ impl AsyncComponent for SignIn {
                 if res.state != self.state {
                     return self.bail_out(widgets, sender, IndieauthError {
                         kind: kittybox_indieauth::ErrorKind::InvalidRequest,
-                        msg: Some("state doesn't match what we remember, ceremony aborted".to_owned()),
+                        msg: Some(gettext("state doesn't match what we remember, ceremony aborted")),
                         error_uri: None,
                     }.into())
                 }
@@ -459,7 +460,7 @@ impl AsyncComponent for SignIn {
                 if res.iss != metadata.issuer {
                     return self.bail_out(widgets, sender, IndieauthError {
                         kind: kittybox_indieauth::ErrorKind::InvalidRequest,
-                        msg: Some("issuer doesn't match what we remember, ceremony aborted".to_owned()),
+                        msg: Some(gettext("issuer doesn't match what we remember, ceremony aborted")),
                         error_uri: None,
                     }.into())
                 }