mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
Change how gettext is initialized to be more simple
This commit is contained in:
parent
269c4ec70c
commit
bb8c41ad03
2 changed files with 4 additions and 31 deletions
|
@ -105,22 +105,9 @@ class Core(
|
||||||
self.register_introspection_functions()
|
self.register_introspection_functions()
|
||||||
|
|
||||||
# Initialize gettext
|
# Initialize gettext
|
||||||
if deluge.common.windows_check() or deluge.common.osx_check():
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
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"))
|
|
||||||
# Setup signals
|
# Setup signals
|
||||||
signal.signal(signal.SIGINT, self._shutdown)
|
signal.signal(signal.SIGINT, self._shutdown)
|
||||||
signal.signal(signal.SIGTERM, self._shutdown)
|
signal.signal(signal.SIGTERM, self._shutdown)
|
||||||
|
|
|
@ -117,22 +117,8 @@ class GtkUI:
|
||||||
gobject.threads_init()
|
gobject.threads_init()
|
||||||
|
|
||||||
# Initialize gettext
|
# Initialize gettext
|
||||||
if deluge.common.windows_check() or deluge.common.osx_check():
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
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"))
|
|
||||||
|
|
||||||
# Setup signals
|
# Setup signals
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue