From 759bb8cc5d9e50dbf8dc03b950e8aa7e48dea5b8 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 23 Oct 2008 08:21:25 +0000 Subject: [PATCH] Fix locale stuff on OS X --- deluge/core/core.py | 2 +- deluge/ui/gtkui/gtkui.py | 2 +- deluge/ui/webui/deluge_webserver.py | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/deluge/core/core.py b/deluge/core/core.py index 55708e57d..1ef9e9fa3 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -113,7 +113,7 @@ class Core( self.register_introspection_functions() # Initialize gettext - if deluge.common.windows_check(): + if deluge.common.windows_check() or deluge.common.osx_check(): locale.setlocale(locale.LC_ALL, '') else: locale.setlocale(locale.LC_MESSAGES, '') diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 17ebd2bda..a1c3795b4 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -125,7 +125,7 @@ class GtkUI: gobject.threads_init() # Initialize gettext - if deluge.common.windows_check(): + if deluge.common.windows_check() or deluge.common.osx_check(): locale.setlocale(locale.LC_ALL, '') else: locale.setlocale(locale.LC_MESSAGES, '') diff --git a/deluge/ui/webui/deluge_webserver.py b/deluge/ui/webui/deluge_webserver.py index beb91d019..ffe5b71ce 100644 --- a/deluge/ui/webui/deluge_webserver.py +++ b/deluge/ui/webui/deluge_webserver.py @@ -31,6 +31,7 @@ import web import random import gettext import locale +import deluge.common from deluge.configmanager import ConfigManager import pkg_resources from deluge.ui.client import sclient @@ -38,11 +39,15 @@ import components from deluge.log import LOG as log # Initialize gettext -locale.setlocale(locale.LC_MESSAGES, '') -locale.bindtextdomain("deluge", +if deluge.common.windows_check() or deluge.common.osx_check(): + locale.setlocale(locale.LC_ALL, '') +else: + locale.setlocale(locale.LC_MESSAGES, '') + locale.bindtextdomain("deluge", pkg_resources.resource_filename( "deluge", "i18n")) -locale.textdomain("deluge") + locale.textdomain("deluge") + gettext.bindtextdomain("deluge", pkg_resources.resource_filename( "deluge", "i18n"))