mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 20:44:50 +00:00
Change how gettext is initialized to be more simple
This commit is contained in:
parent
269c4ec70c
commit
bb8c41ad03
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user