Fix previous commit [5864]

This commit is contained in:
Andrew Resch 2009-10-24 03:47:35 +00:00
parent c6eaec6998
commit c6d4208a29
1 changed files with 15 additions and 15 deletions

View File

@ -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