From 69e215400444e4b4520821a24edf4898efe235c5 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Wed, 17 Dec 2008 01:01:49 +0000 Subject: [PATCH] Make preferences tabs translatable --- deluge/plugins/blocklist/blocklist/gtkui.py | 4 ++-- deluge/plugins/label/label/gtkui/__init__.py | 7 ------- deluge/plugins/label/label/gtkui/label_config.py | 4 ++-- deluge/ui/gtkui/preferences.py | 4 ++-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/deluge/plugins/blocklist/blocklist/gtkui.py b/deluge/plugins/blocklist/blocklist/gtkui.py index 8c18ab3c3..e46a46638 100644 --- a/deluge/plugins/blocklist/blocklist/gtkui.py +++ b/deluge/plugins/blocklist/blocklist/gtkui.py @@ -52,7 +52,7 @@ class GtkUI(ui.UI): log.debug("Blocklist GtkUI disable..") # Remove the preferences page - self.plugin.remove_preferences_page("Blocklist") + self.plugin.remove_preferences_page(_("Blocklist")) # Remove status item component.get("StatusBar").remove_item(self.status_item) @@ -189,5 +189,5 @@ class GtkUI(ui.UI): # Add the page to the preferences dialog self.plugin.add_preferences_page( - "Blocklist", + _("Blocklist"), self.glade.get_widget("blocklist_prefs_box")) diff --git a/deluge/plugins/label/label/gtkui/__init__.py b/deluge/plugins/label/label/gtkui/__init__.py index baa85efab..2f121ff81 100644 --- a/deluge/plugins/label/label/gtkui/__init__.py +++ b/deluge/plugins/label/label/gtkui/__init__.py @@ -73,11 +73,6 @@ class GtkUI(ui.UI): except Exception, e: log.debug(e) - - def get_pixmap(self, fname): - """Returns a pixmap file included with plugin""" - return pkg_resources.resource_filename("blocklist", os.path.join("data", fname)) - def load_interface(self): #sidebar #disabled @@ -106,5 +101,3 @@ class GtkUI(ui.UI): log.debug("add columns") component.get("TorrentView").add_text_column(_("Label"), status_field=["label"]) - - diff --git a/deluge/plugins/label/label/gtkui/label_config.py b/deluge/plugins/label/label/gtkui/label_config.py index 6811902e4..990a2873e 100644 --- a/deluge/plugins/label/label/gtkui/label_config.py +++ b/deluge/plugins/label/label/gtkui/label_config.py @@ -45,14 +45,14 @@ class LabelConfig(object): self.glade = gtk.glade.XML(self.get_resource("label_pref.glade")) - self.plugin.add_preferences_page("Label", self.glade.get_widget("label_prefs_box")) + self.plugin.add_preferences_page(_("Label"), self.glade.get_widget("label_prefs_box")) self.plugin.register_hook("on_show_prefs", self.load_settings) self.plugin.register_hook("on_apply_prefs", self.on_apply_prefs) self.load_settings() def unload(self): - self.plugin.remove_preferences_page("Label") + self.plugin.remove_preferences_page(_("Label")) self.plugin.deregister_hook("on_apply_prefs", self.on_apply_prefs) self.plugin.deregister_hook("on_show_prefs", self.load_settings) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 8413a4323..5fa5964b2 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -56,8 +56,8 @@ class Preferences(component.Component): self.treeview.append_column(column) # Add the default categories i = 0 - for category in ["Downloads", "Network", "Bandwidth", "Interface", - "Other", "Daemon", "Queue", "Proxy", "Notification", "Plugins"]: + for category in [_("Downloads"), _("Network"), _("Bandwidth"), _("Interface"), + _("Other"), _("Daemon"), _("Queue"), _("Proxy"), _("Notification"), _("Plugins")]: self.liststore.append([i, category]) i += 1