about summary refs log tree commit diff
path: root/src/application.rs
diff options
context:
space:
mode:
authormusiclover <musiclover382@protonmail.com>2022-04-03 20:22:58 +0200
committermusiclover <musiclover382@protonmail.com>2022-04-03 20:22:58 +0200
commit737bb24daceef281aba3dfefa9b161cf2a34d0a5 (patch)
tree2ea981a127abae437dc649696bb052efa3a0468e /src/application.rs
parent3184c43930df7a4da9651dea33e70ecd74c044ae (diff)
downloadFurtherance-737bb24daceef281aba3dfefa9b161cf2a34d0a5.tar.zst
Make strings translatable in rust source code
Diffstat (limited to 'src/application.rs')
-rwxr-xr-xsrc/application.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/application.rs b/src/application.rs
index bc90642..e5153da 100755
--- a/src/application.rs
+++ b/src/application.rs
@@ -14,6 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+use gettextrs::*;
 use glib::clone;
 use gtk::prelude::*;
 use gtk::subclass::prelude::*;
@@ -124,7 +125,7 @@ impl FurtheranceApplication {
             .program_name("Furtherance")
             .logo_icon_name(config::APP_ID)
             .version(config::VERSION)
-            .comments("Track your time without being tracked.")
+            .comments(&gettext("Track your time without being tracked."))
             .copyright("© 2022 Ricky Kresslein")
             .authors(vec!["Ricky Kresslein <rk@lakoliu.com>".into()])
             .website("https://furtherance.app")
@@ -142,17 +143,17 @@ impl FurtheranceApplication {
             gtk::DialogFlags::MODAL,
             gtk::MessageType::Question,
             gtk::ButtonsType::None,
-            Some("<span size='x-large' weight='bold'>Delete history?</span>"),
+            Some(&format!("<span size='x-large' weight='bold'>{}</span>", &gettext("Delete history?"))),
         );
         dialog.add_buttons(&[
-            ("Cancel", gtk::ResponseType::Reject),
-            ("Delete", gtk::ResponseType::Accept)
+            (&gettext("Cancel"), gtk::ResponseType::Reject),
+            (&gettext("Delete"), gtk::ResponseType::Accept)
         ]);
 
         let message_area = dialog.message_area().downcast::<gtk::Box>().unwrap();
-        let explanation = gtk::Label::new(Some("This will delete ALL of your task history."));
+        let explanation = gtk::Label::new(Some(&gettext("This will delete ALL of your task history.")));
         let instructions = gtk::Label::new(Some(
-            "Type DELETE in the box below then click Delete to proceed."));
+            &gettext("Type DELETE in the box below then click Delete to proceed.")));
         let delete_entry = gtk::Entry::new();
         message_area.append(&explanation);
         message_area.append(&instructions);
@@ -160,7 +161,7 @@ impl FurtheranceApplication {
 
         dialog.connect_response(clone!(@weak dialog = > move |_, resp| {
             if resp == gtk::ResponseType::Accept {
-                if delete_entry.text().to_uppercase() == "DELETE" {
+                if delete_entry.text().to_uppercase() == gettext("DELETE") {
                     let _ = database::delete_all();
                     window.reset_history_box();
                     dialog.close();