diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/lib.rs b/src/lib.rs index 530eab6..ee92350 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +use gettextrs::*; use adw::prelude::*; use libsecret::prelude::{RetrievableExtManual, RetrievableExt}; use relm4::{actions::{RelmAction, RelmActionGroup}, gtk, loading_widgets::LoadingWidgets, prelude::{AsyncComponent, AsyncComponentController, AsyncComponentParts, AsyncController, ComponentController, Controller}, AsyncComponentSender, Component, RelmWidgetExt}; @@ -14,7 +15,7 @@ pub mod components { }; pub(crate) mod tag_pill; - // pub(crate) use tag_pill::{TagPill, TagPillDelete}; + // pub(crate) use tag_pill::{TagPill, TagPillDelete} pub mod signin; pub use signin::{SignIn, Output as SignInOutput}; @@ -127,7 +128,7 @@ impl App { fn about() -> adw::AboutDialog { adw::AboutDialog::builder() - .application_name("Bowl for Kittybox") + .application_name(gettext("Bowl for Kittybox")) .developer_name("Vika Shleina") .version(env!("CARGO_PKG_VERSION")) .website("https://kittybox.fireburn.ru/bowl/") @@ -165,9 +166,9 @@ impl AsyncComponent for App { menu! { main_menu: { - "Sign out" => SignOutAction, - "Preferences" => PreferencesAction, - "About" => AboutAction, + &gettext("Sign out") => SignOutAction, + &gettext("Preferences") => PreferencesAction, + &gettext("About") => AboutAction, } } @@ -181,10 +182,10 @@ impl AsyncComponent for App { #[watch] set_title: if model.micropub.is_none() { - Some("Bowl – Sign in with your website") + Some(gettext("Bowl - Sign in with your website")) } else { - Some("Bowl") - }, + Some(gettext("Bowl")) + }.as_deref(), adw::ToolbarView { add_top_bar = &adw::HeaderBar { @@ -197,7 +198,7 @@ impl AsyncComponent for App { }, pack_end = >k::Button { set_icon_name: "document-send-symbolic", - set_tooltip: "Send post", + set_tooltip: &gettext("Publish"), #[watch] set_visible: model.micropub.is_some(), #[watch] @@ -327,7 +328,7 @@ impl AsyncComponent for App { Some(&self.secret_schema), attributes.clone(), Some(libsecret::COLLECTION_DEFAULT), - &format!("Micropub access token for {}", &data.me), + &gettext!("Micropub access token for {}", &data.me), &data.access_token ).await { Ok(()) => {}, |