Change how gettext is initialized to be more simple

This commit is contained in:
Andrew Resch 2008-11-29 20:44:53 +00:00
parent 269c4ec70c
commit bb8c41ad03
2 changed files with 4 additions and 31 deletions

View File

@ -105,22 +105,9 @@ class Core(
self.register_introspection_functions()
# Initialize gettext
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.setlocale(locale.LC_ALL, '')
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
gettext.bindtextdomain("deluge",
pkg_resources.resource_filename(
"deluge", "i18n"))
gettext.textdomain("deluge")
gettext.install("deluge",
pkg_resources.resource_filename(
"deluge", "i18n"))
# Setup signals
signal.signal(signal.SIGINT, self._shutdown)
signal.signal(signal.SIGTERM, self._shutdown)

View File

@ -117,22 +117,8 @@ class GtkUI:
gobject.threads_init()
# Initialize gettext
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")
gettext.bindtextdomain("deluge",
pkg_resources.resource_filename(
"deluge", "i18n"))
gettext.textdomain("deluge")
gettext.install("deluge",
pkg_resources.resource_filename(
"deluge", "i18n"))
locale.setlocale(locale.LC_ALL, '')
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
# Setup signals
try: