ungana

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README

commit 2afc0320996f46a1720ca025b2877cd72b3ce543
parent fe8e791733bf0aa3ea86d970230488f92af6fb92
Author: lash <dev@holbrook.no>
Date:   Sun, 31 Aug 2025 05:12:19 +0100

Hello world translation

Diffstat:
M.gitignore | 6++++--
Mgui/base.py | 13++++++++++++-
Alocales/es/LC_MESSAGES/messages.po | 18++++++++++++++++++
Alocales/ungana.pot | 5+++++
4 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -35,4 +35,7 @@ htmlcov/ Thumbs.db # Generated ical files -*.ics -\ No newline at end of file +*.ics + +# Compiled gettext files +*.mo diff --git a/gui/base.py b/gui/base.py @@ -1,5 +1,6 @@ import sys import logging +import gettext import gi gi.require_version('Gtk', '4.0') @@ -11,6 +12,8 @@ from ungana.ical import ICalManager logging.basicConfig(level=logging.DEBUG) logg = logging.getLogger() +_ = gettext.gettext + class MainWindow(Gtk.ApplicationWindow): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -48,11 +51,17 @@ class MainWindow(Gtk.ApplicationWindow): entry = Gtk.Entry(placeholder_text="") self.box_main.append(entry) + self.status = Gtk.Statusbar() + self.box_main.append(self.status) + + def load(self, fp): self.cal = ICalManager() self.cal.load_ical_file(fp) ev = self.cal.get_first_event(self.cal.calendar) self.entry_summary.set_text(ev.get('summary')) + status_id = self.status.get_context_id("ical") + self.status.push(status_id, "{}: {:s}".format(_("Loaded ical file"), fp)) class Ungana(Adw.Application): @@ -68,6 +77,8 @@ class Ungana(Adw.Application): self.win.load(self.file) self.win.present() - +#gettext.install(gettext.translation("ungana", localedir="locale", languages=['es'])) +gettext.bindtextdomain("messages", "locales") +gettext.textdomain("messages") app = Ungana(application_id="org.defalsify.ungana", initial_calendar=sys.argv[1]) app.run(None) diff --git a/locales/es/LC_MESSAGES/messages.po b/locales/es/LC_MESSAGES/messages.po @@ -0,0 +1,18 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"\"\"Project-Id-Version: Ungana 2.1\n" +"\"\"Report-Msgid-Bugs-To: ungana@defalsify.org\n" +"\"\"POT-Creation-Date: 2025-08-31 03:58+0000\n" +"X-Generator: Poedit 3.6\n" + +msgid "Loaded ical file" +msgstr "Archivo ical cargado" diff --git a/locales/ungana.pot b/locales/ungana.pot @@ -0,0 +1,5 @@ +msgid "" +msgstr """Project-Id-Version: Ungana 2.1\n""Report-Msgid-Bugs-To: ungana@defalsify.org\n""POT-Creation-Date: 2025-08-31 03:58+0000\n" + +msgid "Loaded ical file" +msgstr ""