Clean-up gettext code and make it more portable
This commit is contained in:
parent
6bd1682728
commit
34671971be
|
@ -106,6 +106,12 @@ class Core(
|
||||||
|
|
||||||
# Initialize gettext
|
# Initialize gettext
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
if hasattr(locale, "bindtextdomain"):
|
||||||
|
locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
if hasattr(locale, "textdomain"):
|
||||||
|
locale.textdomain("deluge")
|
||||||
|
gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
gettext.textdomain("deluge")
|
||||||
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
|
||||||
# Setup signals
|
# Setup signals
|
||||||
|
|
|
@ -118,6 +118,12 @@ class GtkUI:
|
||||||
|
|
||||||
# Initialize gettext
|
# Initialize gettext
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
if hasattr(locale, "bindtextdomain"):
|
||||||
|
locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
if hasattr(locale, "textdomain"):
|
||||||
|
locale.textdomain("deluge")
|
||||||
|
gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
gettext.textdomain("deluge")
|
||||||
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
|
||||||
# Setup signals
|
# Setup signals
|
||||||
|
|
Loading…
Reference in New Issue