[gnome-todo/wip/piotrdrag/untranslated-python] plugins: Fix gettext import in Python files
- From: Piotr Drąg <piotrdrag src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo/wip/piotrdrag/untranslated-python] plugins: Fix gettext import in Python files
- Date: Sat, 10 Feb 2018 11:37:10 +0000 (UTC)
commit bf9aab4b6f656fbb2b8bcedf1e5aceb5218f94b6
Author: Piotr Drąg <piotrdrag gmail com>
Date: Sat Feb 10 12:32:41 2018 +0100
plugins: Fix gettext import in Python files
Closes https://gitlab.gnome.org/GNOME/gnome-todo/issues/140
plugins/score/score/__init__.py | 8 +++++++-
plugins/unscheduled-panel/unscheduled-panel/__init__.py | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/plugins/score/score/__init__.py b/plugins/score/score/__init__.py
index 6bf7a94..d289f3c 100644
--- a/plugins/score/score/__init__.py
+++ b/plugins/score/score/__init__.py
@@ -24,7 +24,13 @@ gi.require_version('Peas', '1.0')
from gi.repository import Gio, GLib, GObject, Gtd, Gtk, Peas
-from gettext import gettext as _
+try:
+ import gettext
+ gettext.bindtextdomain('gnome-todo')
+ gettext.textdomain('gnome-todo')
+ _ = gettext.gettext
+except:
+ _ = lambda s: s
class ScoreManager(GObject.Object):
diff --git a/plugins/unscheduled-panel/unscheduled-panel/__init__.py
b/plugins/unscheduled-panel/unscheduled-panel/__init__.py
index 9dbd5e7..dc6fcfb 100644
--- a/plugins/unscheduled-panel/unscheduled-panel/__init__.py
+++ b/plugins/unscheduled-panel/unscheduled-panel/__init__.py
@@ -24,7 +24,13 @@ gi.require_version('Peas', '1.0')
from gi.repository import Gio, GLib, GObject, Gtd, Gtk, Peas
-from gettext import gettext as _
+try:
+ import gettext
+ gettext.bindtextdomain('gnome-todo')
+ gettext.textdomain('gnome-todo')
+ _ = gettext.gettext
+except:
+ _ = lambda s: s
class UnscheduledPanel(Gtk.Box, Gtd.Panel):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]