From c6d4208a29f692d94cfdc481883f6bfb4f726dbd Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 24 Oct 2009 03:47:35 +0000 Subject: [PATCH] Fix previous commit [5864] --- deluge/ui/gtkui/gtkui.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index dc42316cd..37f44861c 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -47,6 +47,21 @@ import pkg_resources import gtk, gtk.glade import sys +# Initialize gettext +try: + if hasattr(locale, "bindtextdomain"): + locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n")) + if hasattr(locale, "textdomain"): + locale.textdomain("deluge") + gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n")) + gettext.textdomain("deluge") + gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n")) + gtk.glade.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n")) + gtk.glade.textdomain("deluge") +except Exception, e: + log.error("Unable to initialize gettext/locale!") + log.exception(e) + import deluge.component as component from deluge.ui.client import client from mainwindow import MainWindow @@ -141,21 +156,6 @@ DEFAULT_PREFS = { class GtkUI(object): def __init__(self, args): - - # Initialize gettext - try: - if hasattr(locale, "bindtextdomain"): - locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n")) - if hasattr(locale, "textdomain"): - locale.textdomain("deluge") - gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n")) - gettext.textdomain("deluge") - gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n")) - gtk.glade.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n")) - gtk.glade.textdomain("deluge") - except Exception, e: - log.error("Unable to initialize gettext/locale!") - log.exception(e) # Setup signals try: import gnome.ui