From 79daf89ba8ba1b54e9b16db88ee8ec22a477c05a Mon Sep 17 00:00:00 2001 From: oscfdezdz Date: Fri, 21 Jan 2022 20:26:01 +0100 Subject: [PATCH 1/2] po: update translatable strings --- data/net.daase.journable.appdata.xml.in | 2 +- po/POTFILES | 3 +-- src/window.py | 12 ++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/data/net.daase.journable.appdata.xml.in b/data/net.daase.journable.appdata.xml.in index 95673ca..3f2b340 100644 --- a/data/net.daase.journable.appdata.xml.in +++ b/data/net.daase.journable.appdata.xml.in @@ -4,7 +4,7 @@ Journable CC0-1.0 GPL-3.0-or-later - Björn Daase + Björn Daase A simple bullet journal CC0-1.0 GPL-3.0+ diff --git a/po/POTFILES b/po/POTFILES index e55c9ca..03d8e60 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -1,7 +1,6 @@ data/net.daase.journable.desktop.in data/net.daase.journable.appdata.xml.in data/net.daase.journable.gschema.xml -src/window.ui +src/ui/window.ui src/main.py src/window.py - diff --git a/src/window.py b/src/window.py index 2b28ce0..36eaae0 100644 --- a/src/window.py +++ b/src/window.py @@ -67,7 +67,7 @@ class JournableWindow(Gtk.ApplicationWindow): self.is_unsaved_file = True self.has_unsaved_changes = False self.current_journal_path = None - self.current_journal_basename = 'Untitled' + self.current_journal_basename = _('Untitled') self.update_header_bar_information() def update_file_information(self, journal_file_path): @@ -93,12 +93,12 @@ class JournableWindow(Gtk.ApplicationWindow): def add_filters(self, file_chooser): filter_json = Gtk.FileFilter() - filter_json.set_name('JSON files') + filter_json.set_name(_('JSON files')) filter_json.add_mime_type('application/json') file_chooser.add_filter(filter_json) filter_all = Gtk.FileFilter() - filter_all.set_name('All files') + filter_all.set_name(_('All files')) filter_all.add_pattern('*') file_chooser.add_filter(filter_all) @@ -203,10 +203,10 @@ class JournableWindow(Gtk.ApplicationWindow): if not self.has_unsaved_changes: file_chooser = Gtk.FileChooserNative.new( - 'Choose a file', + _('Choose a file'), self, Gtk.FileChooserAction.OPEN, - '_Open', + _('_Open'), '_Cancel' ) self.add_filters(file_chooser) @@ -225,7 +225,7 @@ class JournableWindow(Gtk.ApplicationWindow): 'Save as', self, Gtk.FileChooserAction.SAVE, - '_Save', + _('_Save'), '_cancel' ) self.add_filters(file_chooser) -- GitLab From 243e4b4f416673957dcd454174bf867591c9f598 Mon Sep 17 00:00:00 2001 From: oscfdezdz Date: Fri, 21 Jan 2022 20:26:26 +0100 Subject: [PATCH 2/2] po: fix translations --- src/journable.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/journable.in b/src/journable.in index 1a68aa3..067bb49 100755 --- a/src/journable.in +++ b/src/journable.in @@ -21,6 +21,7 @@ import os import sys import signal import gettext +import locale VERSION = '@VERSION@' pkgdatadir = '@pkgdatadir@' @@ -29,6 +30,8 @@ localedir = '@localedir@' sys.path.insert(1, pkgdatadir) signal.signal(signal.SIGINT, signal.SIG_DFL) gettext.install('journable', localedir) +locale.bindtextdomain('journable', localedir) +locale.textdomain('journable') if __name__ == '__main__': import gi -- GitLab