diff --git a/deluge/core/core.py b/deluge/core/core.py index ec495c841..6d895ff48 100644 --- a/deluge/core/core.py +++ b/deluge/core/core.py @@ -106,6 +106,12 @@ class Core( # Initialize gettext 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")) # Setup signals diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index 449f27006..186ed0852 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -118,6 +118,12 @@ class GtkUI: # Initialize gettext 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")) # Setup signals