Module: deluge Branch: master Commit: acb747bfd570bcfabcffb3c54cea1508bd2a4c75
Author: Pedro Algarvio <pe...@algarvio.me> Date: Sun Jul 10 00:43:56 2011 +0100 Log from where translations are being loaded. --- deluge/common.py | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/deluge/common.py b/deluge/common.py index b246e66..caa45b6 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -690,18 +690,24 @@ def create_localclient_account(append=False): # Initialize gettext def setup_translations(setup_pygtk=False): + translations_path = resource_filename("deluge", "i18n") + log.info("Setting up translations from %s", translations_path) + try: if hasattr(locale, "bindtextdomain"): - locale.bindtextdomain("deluge", resource_filename("deluge", "i18n")) + locale.bindtextdomain("deluge", translations_path) if hasattr(locale, "textdomain"): locale.textdomain("deluge") - gettext.bindtextdomain("deluge", resource_filename("deluge", "i18n")) + gettext.bindtextdomain("deluge", translations_path) gettext.textdomain("deluge") - gettext.install("deluge", resource_filename("deluge", "i18n")) + gettext.install("deluge", translations_path) if setup_pygtk: + # Even though we're not using glade anymore, let's set it up so that + # plugins still using it get properly translated. + log.info("Setting up GTK translations from %s", translations_path) import gtk import gtk.glade - gtk.glade.bindtextdomain("deluge", resource_filename("deluge", "i18n")) + gtk.glade.bindtextdomain("deluge", translations_path) gtk.glade.textdomain("deluge") except Exception, e: log.error("Unable to initialize gettext/locale!") -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to deluge-commit@googlegroups.com. To unsubscribe from this group, send email to deluge-commit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.