[eog-plugins] pythonconsole: Make UI labels translatable



commit 176264f37abe4d70aa1fa6b4bb73670b1107ca5c
Author: Felix Riemann <friemann gnome org>
Date:   Mon Feb 20 19:06:00 2012 +0100

    pythonconsole: Make UI labels translatable

 plugins/pythonconsole/__init__.py |    7 +++++--
 po/POTFILES.in                    |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/pythonconsole/__init__.py b/plugins/pythonconsole/__init__.py
index 285e65e..4fafdd1 100644
--- a/plugins/pythonconsole/__init__.py
+++ b/plugins/pythonconsole/__init__.py
@@ -30,6 +30,9 @@ from gi.repository import GObject, Gtk, Eog, PeasGtk
 from console import PythonConsole
 from config import PythonConsoleConfigWidget
 
+import gettext
+_ = gettext.translation('eog-plugins', fallback=True).ugettext
+
 ui_str = """
     <ui>
         <menubar name="MainMenu">
@@ -58,7 +61,7 @@ class PythonConsolePlugin(GObject.Object, Eog.WindowActivatable, PeasGtk.Configu
         ui_manager = self.window.get_ui_manager()
         self.action_group = Gtk.ActionGroup('PythonConsole')
         self.action_group.add_actions([('PythonConsole', None, \
-            'P_ython Console', None, None, self.console_cb)], self.window)
+            _('P_ython Console'), None, None, self.console_cb)], self.window)
         ui_manager.insert_action_group(self.action_group, 0)
         self.ui_id = ui_manager.add_ui_from_string(ui_str)
 
@@ -82,7 +85,7 @@ class PythonConsolePlugin(GObject.Object, Eog.WindowActivatable, PeasGtk.Configu
             console.eval('print "You can access the main window through ' \
                          '\'window\' :\\n%s" % window', False)
 
-            self.console_window.set_title('Python Console')
+            self.console_window.set_title(_('Python Console'))
             self.console_window.add(console)
             self.console_window.connect('delete-event', self.on_delete_cb)
             self.console_window.show_all()
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fe26f94..c3ab65e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -15,6 +15,7 @@ plugins/postasa/eog-postasa-plugin.c
 plugins/postasa/postasa.plugin.desktop.in
 plugins/postr/eog-postr-plugin.c
 plugins/postr/postr.plugin.desktop.in
+plugins/pythonconsole/__init__.py
 [type: gettext/glade]plugins/pythonconsole/config.ui
 plugins/pythonconsole/org.gnome.eog.plugins.pythonconsole.gschema.xml.in.in
 plugins/pythonconsole/pythonconsole.plugin.desktop.in



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]