diff options
-rwxr-xr-x | data/com.lakoliu.Furtherance.desktop.in | 2 | ||||
-rw-r--r-- | po/Furtherance.pot | 270 | ||||
-rwxr-xr-x | po/POTFILES | 11 | ||||
-rwxr-xr-x | src/application.rs | 15 | ||||
-rwxr-xr-x | src/gtk/task_details.ui | 6 | ||||
-rwxr-xr-x | src/ui/task_details.rs | 27 | ||||
-rwxr-xr-x | src/ui/tasks_page.rs | 5 | ||||
-rwxr-xr-x | src/ui/window.rs | 16 |
8 files changed, 317 insertions, 35 deletions
diff --git a/data/com.lakoliu.Furtherance.desktop.in b/data/com.lakoliu.Furtherance.desktop.in index ee5cde6..d8f0eb3 100755 --- a/data/com.lakoliu.Furtherance.desktop.in +++ b/data/com.lakoliu.Furtherance.desktop.in @@ -8,4 +8,4 @@ Terminal=false Type=Application Categories=GTK;Utility; StartupNotify=true -Keywords=timer;tracker;clock;tasks;productivity +Keywords=timer;tracker;clock;tasks;productivity; diff --git a/po/Furtherance.pot b/po/Furtherance.pot new file mode 100644 index 0000000..4117ccc --- /dev/null +++ b/po/Furtherance.pot @@ -0,0 +1,270 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the Furtherance package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Furtherance\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-04-02 16:51+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + + +#: data/com.lakoliu.Furtherance.appdata.xml.in:6 data/com.lakoliu.Furtherance.desktop.in:4 src/application.rs:128 +msgid "Track your time without being tracked." +msgstr "" + +#: data/com.lakoliu.Furtherance.appdata.xml.in:13 +msgid "Furtherance is an elegant time tracking app built for Gnome with Rust " +"and GTK4. In addition to tracking time spent on tasks, you can edit that " +"time, delete entries, and change settings. It even has idle detection." +msgstr "" + +#: data/com.lakoliu.Furtherance.appdata.xml.in:45 +msgid "First stable release of Furtherance." +msgstr "" + +#: data/com.lakoliu.Furtherance.appdata.xml.in:48 +msgid "Track time spent on tasks" +msgstr "" + +#: data/com.lakoliu.Furtherance.appdata.xml.in:49 +msgid "Change/delete recorded times" +msgstr "" + +#: data/com.lakoliu.Furtherance.appdata.xml.in:50 +msgid "Idle detection" +msgstr "" + +#: data/com.lakoliu.Furtherance.desktop.in:3 +msgid "Time Tracker" +msgstr "" + +#. TRANSLATORS: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! +#: data/com.lakoliu.Furtherance.desktop.in:11 +msgid "timer;tracker;clock;tasks;productivity;" +msgstr "" + +#: src/gtk/window.ui:20 +msgid "Main Menu" +msgstr "" + +#: src/gtk/window.ui:56 +msgid "Task Name" +msgstr "" + +#: src/gtk/window.ui:81 +msgid "_Preferences" +msgstr "" + +#: src/gtk/window.ui:85 +msgid "_Delete history" +msgstr "" + +#: src/gtk/window.ui:89 +msgid "_About Furtherance" +msgstr "" + +#: src/gtk/task_row.ui:18 +msgid "Task" +msgstr "" + +#: src/gtk/task_row.ui:29 +msgid "Time" +msgstr "" + +#: src/gtk/task_details.ui:8 +msgid "Task Details" +msgstr "" + +#: src/gtk/task_details.ui:73 src/ui/task_details.rs:177 +msgid "Start" +msgstr "" + +#: src/gtk/task_details.ui:81 src/ui/task_details.rs:179 +msgid "Stop" +msgstr "" + +#: src/gtk/task_details.ui:89 +msgid "Total" +msgstr "" + +#: src/gtk/task_details.ui:116 +msgid "Delete all" +msgstr "" + +#: src/gtk/preferences_window.ui:7 +msgid "General" +msgstr "" + +#: src/gtk/preferences_window.ui:10 +msgid "Appearance" +msgstr "" + +#: src/gtk/preferences_window.ui:14 +msgid "_Dark theme" +msgstr "" + +#: src/gtk/preferences_window.ui:28 +msgid "Idle" +msgstr "" + +#: src/gtk/preferences_window.ui:32 +msgid "Notify of idle" +msgstr "" + +#: src/gtk/preferences_window.ui:33 +msgid "(Gnome only)" +msgstr "" + +#: src/gtk/preferences_window.ui:38 +msgid "_Minutes to idle" +msgstr "" + +#: src/gtk/preferences_window.ui:39 +msgid "Number of minutes before the user is considered idle" +msgstr "" + +#: src/gtk/preferences_window.ui:63 +msgid "Task List" +msgstr "" + +#: src/gtk/preferences_window.ui:67 +msgid "Limit tasks shown" +msgstr "" + +#: src/gtk/preferences_window.ui:68 +msgid "Only show X number of days in the saved tasks list" +msgstr "" + +#: src/gtk/preferences_window.ui:73 +msgid "_Days ago" +msgstr "" + +#: src/gtk/preferences_window.ui:74 +msgid "Number of days to display in the list" +msgstr "" + +#: src/gtk/preferences_window.ui:96 +msgid "_Delete confirmation" +msgstr "" + +#: src/gtk/preferences_window.ui:108 +msgid "_Show seconds" +msgstr "" + +#: src/gtk/preferences_window.ui:111 +msgid "Tasks list only. Seconds always show on timer" +msgstr "" + +#: src/gtk/history_box.ui:25 +msgid "Start Tracking" +msgstr "" + +#: src/gtk/history_box.ui:44 +msgid "Type your task and press start" +msgstr "" + +#: src/gtk/history_box.ui:63 +msgid "Prior tasks will show up here" +msgstr "" + +#: src/application.rs:146 +msgid "Delete history?" +msgstr "" + +#: src/application.rs:149 src/ui/task_details.rs:470 +msgid "Cancel" +msgstr "" + +#: src/application.rs:150 src/ui/task_details.rs:471 +msgid "Delete" +msgstr "" + +#: src/application.rs:154 +msgid "This will delete ALL of your task history." +msgstr "" + +#: src/application.rs:156 +msgid "Type DELETE in the box below then click Delete to proceed." +msgstr "" + +#. TRANSLATORS: This must match the translation for "DELETE" in the other string +#: src/application.rs:164 +msgid "DELETE" +msgstr "" + +#: src/ui/window.rs:178 +msgid "No Task Name" +msgstr "" + +#: src/ui/window.rs:180 +msgid "Enter a task name to start the timer." +msgstr "" + +#: src/ui/window.rs:286 +msgid "You have been idle for " +msgstr "" + +#: src/ui/window.rs:287 +msgid ".\nWould you like to discard that time, or continue the clock?" +msgstr "" + +#: src/ui/window.rs:295 src/ui/task_details.rs:167 +msgid "Edit Task" +msgstr "" + +#: src/ui/window.rs:298 +msgid "Discard" +msgstr "" + +#: src/ui/window.rs:299 +msgid "Continue" +msgstr "" + +#: src/ui/tasks_page.rs:146 +msgid "Today" +msgstr "" + +#: src/ui/tasks_page.rs:148 +msgid "Yesterday" +msgstr "" + +#: src/ui/task_details.rs:198 +msgid "*Use the format MMM DD YYYY HH:MM:SS" +msgstr "" + +#: src/ui/task_details.rs:200 +msgid "*Use the format MMM DD YYYY HH:MM" +msgstr "" + +#: src/ui/task_details.rs:206 +msgid "*Start time cannot be later than stop time." +msgstr "" + +#: src/ui/task_details.rs:211 +msgid "*Time cannot be in the future." +msgstr "" + +#: src/ui/task_details.rs:217 +msgid "Delete task" +msgstr "" + +#: src/ui/task_details.rs:243 +msgid "Delete task?" +msgstr "" + +#: src/ui/task_details.rs:466 +msgid "Delete All?" +msgstr "" + +#: src/ui/task_details.rs:468 +msgid "This will delete all occurrences of this task on this day." +msgstr "" diff --git a/po/POTFILES b/po/POTFILES index 1dc8b86..62cfd39 100755 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,4 +1,11 @@ data/com.lakoliu.Furtherance.desktop.in data/com.lakoliu.Furtherance.appdata.xml.in -data/com.lakoliu.Furtherance.gschema.xml -src/window.ui +src/gtk/history_box.ui +src/gtk/preferences_window.ui +src/gtk/task_details.ui +src/gtk/task_row.ui +src/gtk/window.ui +src/application.rs +src/ui/task_details.rs +src/ui/tasks_page.rs +src/ui/window.rs 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(); diff --git a/src/gtk/task_details.ui b/src/gtk/task_details.ui index ccbfc1e..003036b 100755 --- a/src/gtk/task_details.ui +++ b/src/gtk/task_details.ui @@ -70,7 +70,7 @@ <property name="spacing">5</property> <child> <object class="GtkLabel"> - <property name="label">Start</property> + <property name="label" translatable="yes">Start</property> <style> <class name="title-2"/> </style> @@ -78,7 +78,7 @@ </child> <child> <object class="GtkLabel"> - <property name="label">Stop</property> + <property name="label" translatable="yes">Stop</property> <style> <class name="title-2"/> </style> @@ -86,7 +86,7 @@ </child> <child> <object class="GtkLabel"> - <property name="label">Total</property> + <property name="label" translatable="yes">Total</property> <style> <class name="title-2"/> </style> diff --git a/src/ui/task_details.rs b/src/ui/task_details.rs index c45d561..7e306e8 100755 --- a/src/ui/task_details.rs +++ b/src/ui/task_details.rs @@ -15,6 +15,7 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use adw::subclass::prelude::*; +use gettextrs::*; use glib::clone; use gtk::subclass::prelude::*; use gtk::{glib, prelude::*, CompositeTemplate}; @@ -163,7 +164,7 @@ impl FurTaskDetails { gtk::DialogFlags::MODAL, gtk::MessageType::Question, gtk::ButtonsType::OkCancel, - "<span size='x-large' weight='bold'>Edit Task</span>", + &format!("<span size='x-large' weight='bold'>{}</span>", &gettext("Edit Task")), ); dialog.set_use_markup(true); @@ -173,9 +174,9 @@ impl FurTaskDetails { task_name_edit.set_text(&task.task_name); let labels_box = gtk::Box::new(gtk::Orientation::Horizontal, 5); labels_box.set_homogeneous(true); - let start_label = gtk::Label::new(Some("Start")); + let start_label = gtk::Label::new(Some(&gettext("Start"))); start_label.add_css_class("title-4"); - let stop_label = gtk::Label::new(Some("Stop")); + let stop_label = gtk::Label::new(Some(&gettext("Stop"))); stop_label.add_css_class("title-4"); let times_box = gtk::Box::new(gtk::Orientation::Horizontal, 5); times_box.set_homogeneous(true); @@ -194,26 +195,26 @@ impl FurTaskDetails { stop_time_edit.set_text(&stop_time_w_year); let instructions = gtk::Label::new(Some( - "*Use the format MMM DD YYYY HH:MM:SS")); + &gettext("*Use the format MMM DD YYYY HH:MM:SS"))); if !settings_manager::get_bool("show-seconds") { - instructions.set_text("*Use the format MMM DD YYYY HH:MM"); + instructions.set_text(&gettext("*Use the format MMM DD YYYY HH:MM")); } instructions.set_visible(false); instructions.add_css_class("error_message"); let time_error = gtk::Label::new(Some( - "*Start time cannot be later than stop time.")); + &gettext("*Start time cannot be later than stop time."))); time_error.set_visible(false); time_error.add_css_class("error_message"); let future_error = gtk::Label::new(Some( - "*Time cannot be in the future.")); + &gettext("*Time cannot be in the future."))); future_error.set_visible(false); future_error.add_css_class("error_message"); let delete_task_btn = gtk::Button::new(); delete_task_btn.set_icon_name("user-trash-symbolic"); - delete_task_btn.set_tooltip_text(Some("Delete task")); + delete_task_btn.set_tooltip_text(Some(&gettext("Delete task"))); delete_task_btn.set_hexpand(false); delete_task_btn.set_vexpand(false); delete_task_btn.set_halign(gtk::Align::End); @@ -239,7 +240,7 @@ impl FurTaskDetails { gtk::DialogFlags::MODAL, gtk::MessageType::Question, gtk::ButtonsType::OkCancel, - Some("<span size='x-large' weight='bold'>Delete task?</span>"), + Some(&format!("<span size='x-large' weight='bold'>{}</span>", &gettext("Delete task?"))), ); delete_confirmation.connect_response(clone!( @@ -462,12 +463,12 @@ impl FurTaskDetails { gtk::DialogFlags::MODAL, gtk::MessageType::Warning, gtk::ButtonsType::None, - Some("<span size='large'>Delete All?</span>"), + Some(&format!("<span size='large'>{}</span>", &gettext("Delete All?"))), ); - dialog.set_secondary_text(Some("This will delete all occurrences of this task on this day.")); + dialog.set_secondary_text(Some(&gettext("This will delete all occurrences of this task on this day."))); dialog.add_buttons(&[ - ("Delete", gtk::ResponseType::Accept), - ("Cancel", gtk::ResponseType::Reject) + (&gettext("Cancel"), gtk::ResponseType::Reject), + (&gettext("Delete"), gtk::ResponseType::Accept) ]); dialog.connect_response(clone!(@strong dialog => move |_,resp|{ diff --git a/src/ui/tasks_page.rs b/src/ui/tasks_page.rs index 9f0aed3..23439eb 100755 --- a/src/ui/tasks_page.rs +++ b/src/ui/tasks_page.rs @@ -16,6 +16,7 @@ use adw::subclass::prelude::*; use adw::prelude::{PreferencesPageExt, PreferencesGroupExt}; +use gettextrs::*; use gtk::subclass::prelude::*; use gtk::{glib, prelude::*}; use chrono::{DateTime, Local, Duration}; @@ -142,9 +143,9 @@ impl FurTasksPage { for i in 0..uniq_date_list.len() { let group = FurTasksGroup::new(); if uniq_date_list[i] == today { - group.set_title("Today") + group.set_title(&gettext("Today")) } else if uniq_date_list[i] == yesterday{ - group.set_title("Yesterday") + group.set_title(&gettext("Yesterday")) } else { group.set_title(&uniq_date_list[i]) } diff --git a/src/ui/window.rs b/src/ui/window.rs index baca851..c955451 100755 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -15,6 +15,7 @@ // along with this program. If not, see <https://www.gnu.org/licenses/>. use adw::subclass::prelude::AdwApplicationWindowImpl; +use gettextrs::*; use gtk::prelude::*; use gtk::subclass::prelude::*; use gtk::{gio, glib, CompositeTemplate}; @@ -176,9 +177,9 @@ impl FurtheranceWindow { gtk::DialogFlags::MODAL, gtk::MessageType::Error, gtk::ButtonsType::Ok, - Some("<span size='large'>No Task Name</span>"), + Some(&format!("<span size='large'>{}</span>", &gettext("No Task Name"))), ); - dialog.set_secondary_text(Some("Enter a task name to start the timer.")); + dialog.set_secondary_text(Some(&gettext("Enter a task name to start the timer."))); dialog.show(); dialog.connect_response(clone!(@strong dialog => move |_,_|{ @@ -285,19 +286,20 @@ impl FurtheranceWindow { let m = (idle_time / 60) - (h * 60); let s = idle_time - (m * 60); let idle_time_str = format!( - "You have been idle for {:02}:{:02}:{:02}.\nWould you like to discard that time, or continue the clock?", - h, m, s); + "{}{:02}:{:02}:{:02}{}", gettext("You have been idle for "), h, m, s, + gettext(".\nWould you like to discard that time, or continue the clock?") + ); let dialog = gtk::MessageDialog::with_markup( Some(self), gtk::DialogFlags::MODAL, gtk::MessageType::Warning, gtk::ButtonsType::None, - Some("<span size='x-large' weight='bold'>Edit Task</span>"), + Some(&format!("<span size='x-large' weight='bold'>{}</span>", &gettext("Edit Task"))), ); dialog.add_buttons(&[ - ("Discard", gtk::ResponseType::Reject), - ("Continue", gtk::ResponseType::Accept) + (&gettext("Discard"), gtk::ResponseType::Reject), + (&gettext("Continue"), gtk::ResponseType::Accept) ]); dialog.set_secondary_text(Some(&idle_time_str)); |