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