Fix locale stuff on OS X

This commit is contained in:
Andrew Resch 2008-10-23 08:21:25 +00:00
parent ff6906997b
commit 759bb8cc5d
3 changed files with 10 additions and 5 deletions

View File

@ -113,7 +113,7 @@ class Core(
self.register_introspection_functions() self.register_introspection_functions()
# Initialize gettext # Initialize gettext
if deluge.common.windows_check(): if deluge.common.windows_check() or deluge.common.osx_check():
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
else: else:
locale.setlocale(locale.LC_MESSAGES, '') locale.setlocale(locale.LC_MESSAGES, '')

View File

@ -125,7 +125,7 @@ class GtkUI:
gobject.threads_init() gobject.threads_init()
# Initialize gettext # Initialize gettext
if deluge.common.windows_check(): if deluge.common.windows_check() or deluge.common.osx_check():
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
else: else:
locale.setlocale(locale.LC_MESSAGES, '') locale.setlocale(locale.LC_MESSAGES, '')

View File

@ -31,6 +31,7 @@ import web
import random import random
import gettext import gettext
import locale import locale
import deluge.common
from deluge.configmanager import ConfigManager from deluge.configmanager import ConfigManager
import pkg_resources import pkg_resources
from deluge.ui.client import sclient from deluge.ui.client import sclient
@ -38,11 +39,15 @@ import components
from deluge.log import LOG as log from deluge.log import LOG as log
# Initialize gettext # Initialize gettext
locale.setlocale(locale.LC_MESSAGES, '') if deluge.common.windows_check() or deluge.common.osx_check():
locale.bindtextdomain("deluge", locale.setlocale(locale.LC_ALL, '')
else:
locale.setlocale(locale.LC_MESSAGES, '')
locale.bindtextdomain("deluge",
pkg_resources.resource_filename( pkg_resources.resource_filename(
"deluge", "i18n")) "deluge", "i18n"))
locale.textdomain("deluge") locale.textdomain("deluge")
gettext.bindtextdomain("deluge", gettext.bindtextdomain("deluge",
pkg_resources.resource_filename( pkg_resources.resource_filename(
"deluge", "i18n")) "deluge", "i18n"))