mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-25 18:59:38 +00:00
gettext
This commit is contained in:
parent
1e96d2c49c
commit
53e7614419
@ -95,7 +95,7 @@ def estimate_eta(state):
|
|||||||
try:
|
try:
|
||||||
return ftime(get_eta(state["total_size"], state["total_download"], state["download_rate"]))
|
return ftime(get_eta(state["total_size"], state["total_download"], state["download_rate"]))
|
||||||
except ZeroDivisionError:
|
except ZeroDivisionError:
|
||||||
return "Infinity"
|
return _("Infinity")
|
||||||
|
|
||||||
def get_eta(size, done, rate):
|
def get_eta(size, done, rate):
|
||||||
return int( (size - done) / rate )
|
return int( (size - done) / rate )
|
||||||
@ -159,4 +159,4 @@ def open_url_in_browser(link, foobar=None):
|
|||||||
try:
|
try:
|
||||||
webbrowser.open(link)
|
webbrowser.open(link)
|
||||||
except webbrowser.Error:
|
except webbrowser.Error:
|
||||||
print "Error: no webbrowser found"
|
print _("Error: no webbrowser found")
|
||||||
|
@ -74,14 +74,14 @@ PREF_FUNCTIONS = {
|
|||||||
"max_download_rate" : deluge_core.set_download_rate_limit,
|
"max_download_rate" : deluge_core.set_download_rate_limit,
|
||||||
"max_upload_rate" : deluge_core.set_upload_rate_limit
|
"max_upload_rate" : deluge_core.set_upload_rate_limit
|
||||||
}
|
}
|
||||||
STATE_MESSAGES = ( "Queued",
|
STATE_MESSAGES = ( _("Queued"),
|
||||||
"Checking",
|
_("Checking"),
|
||||||
"Connecting",
|
_("Connecting"),
|
||||||
"Downloading Metadata",
|
_("Downloading Metadata"),
|
||||||
"Downloading",
|
_("Downloading"),
|
||||||
"Finished",
|
_("Finished"),
|
||||||
"Seeding",
|
_("Seeding"),
|
||||||
"Allocating"
|
_("Allocating")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,9 +203,9 @@ class DelugeGTK(dbus.service.Object):
|
|||||||
self.plugin_view.set_model(self.plugin_store)
|
self.plugin_view.set_model(self.plugin_store)
|
||||||
self.plugin_view.get_selection().set_select_function(self.plugin_clicked, full=True
|
self.plugin_view.get_selection().set_select_function(self.plugin_clicked, full=True
|
||||||
)
|
)
|
||||||
name_col = dgtk.add_text_column(self.plugin_view, "Name", 0)
|
name_col = dgtk.add_text_column(self.plugin_view, _("Plugin"), 0)
|
||||||
name_col.set_expand(True)
|
name_col.set_expand(True)
|
||||||
dgtk.add_toggle_column(self.plugin_view, "Enabled", 1, toggled_signal=self.plugin_toggled)
|
dgtk.add_toggle_column(self.plugin_view, _("Enabled"), 1, toggled_signal=self.plugin_toggled)
|
||||||
self.prf_glade.signal_autoconnect({'plugin_pref': self.plugin_pref})
|
self.prf_glade.signal_autoconnect({'plugin_pref': self.plugin_pref})
|
||||||
|
|
||||||
def plugin_clicked(self, selection, model, path, is_selected):
|
def plugin_clicked(self, selection, model, path, is_selected):
|
||||||
@ -255,15 +255,15 @@ class DelugeGTK(dbus.service.Object):
|
|||||||
#Just found out there are built-in pygtk methods with similar functionality
|
#Just found out there are built-in pygtk methods with similar functionality
|
||||||
#to these, perhaps I should look into using those.
|
#to these, perhaps I should look into using those.
|
||||||
self.queue_column = dgtk.add_text_column(self.view, "#", 1)
|
self.queue_column = dgtk.add_text_column(self.view, "#", 1)
|
||||||
self.name_column = dgtk.add_text_column(self.view, "Name", 2)
|
self.name_column = dgtk.add_text_column(self.view, _("Name"), 2)
|
||||||
self.size_column = dgtk.add_text_column(self.view, "Size", 3)
|
self.size_column = dgtk.add_text_column(self.view, _("Size"), 3)
|
||||||
self.status_column = dgtk.add_progress_column(self.view, "Status", 4, 5)
|
self.status_column = dgtk.add_progress_column(self.view, _("Status"), 4, 5)
|
||||||
self.seed_column = dgtk.add_text_column(self.view, "Seeders", 6)
|
self.seed_column = dgtk.add_text_column(self.view, _("Seeders"), 6)
|
||||||
self.peer_column = dgtk.add_text_column(self.view, "Peers", 7)
|
self.peer_column = dgtk.add_text_column(self.view, _("Peers"), 7)
|
||||||
self.dl_column = dgtk.add_text_column(self.view, "Download", 8)
|
self.dl_column = dgtk.add_text_column(self.view, _("Download"), 8)
|
||||||
self.ul_column = dgtk.add_text_column(self.view, "Upload", 9)
|
self.ul_column = dgtk.add_text_column(self.view, _("Upload"), 9)
|
||||||
self.eta_column = dgtk.add_text_column(self.view, "Time Remaining", 10)
|
self.eta_column = dgtk.add_text_column(self.view, _("Time Remaining"), 10)
|
||||||
self.share_column = dgtk.add_text_column(self.view, "Ratio", 11)
|
self.share_column = dgtk.add_text_column(self.view, _("Ratio"), 11)
|
||||||
|
|
||||||
self.status_column.set_expand(True)
|
self.status_column.set_expand(True)
|
||||||
|
|
||||||
@ -296,12 +296,11 @@ class DelugeGTK(dbus.service.Object):
|
|||||||
self.peer_store = gtk.ListStore(str, str, str, str, str)
|
self.peer_store = gtk.ListStore(str, str, str, str, str)
|
||||||
self.peer_view.set_model(self.peer_store)
|
self.peer_view.set_model(self.peer_store)
|
||||||
|
|
||||||
self.peer_ip_column = dgtk.add_text_column(self.peer_view, "IP Address", 0)
|
self.peer_ip_column = dgtk.add_text_column(self.peer_view, _("IP Address"), 0)
|
||||||
self.peer_client_column = dgtk.add_text_column(self.peer_view, "Client", 1)
|
self.peer_client_column = dgtk.add_text_column(self.peer_view, _("Client"), 1)
|
||||||
## Note: (maybe) change this column to use a progress column before 0.5 is released
|
self.peer_complete_column = dgtk.add_text_column(self.peer_view, _("Percent Complete"), 2)
|
||||||
self.peer_complete_column = dgtk.add_text_column(self.peer_view, "Percent Complete", 2)
|
self.peer_download_column = dgtk.add_text_column(self.peer_view, _("Download Rate"), 3)
|
||||||
self.peer_download_column = dgtk.add_text_column(self.peer_view, "Download Rate", 3)
|
self.peer_upload_column = dgtk.add_text_column(self.peer_view, _("Upload Rate"), 4)
|
||||||
self.peer_upload_column = dgtk.add_text_column(self.peer_view, "Upload Rate", 4)
|
|
||||||
|
|
||||||
|
|
||||||
def build_file_tab(self):
|
def build_file_tab(self):
|
||||||
@ -309,8 +308,8 @@ class DelugeGTK(dbus.service.Object):
|
|||||||
self.file_store = gtk.ListStore(str, bool)
|
self.file_store = gtk.ListStore(str, bool)
|
||||||
self.file_view.set_model(self.file_store)
|
self.file_view.set_model(self.file_store)
|
||||||
|
|
||||||
self.filename_column = dgtk.add_text_column(self.file_view, "Filename", 0)
|
self.filename_column = dgtk.add_text_column(self.file_view, _("Filename"), 0)
|
||||||
self.filetoggle_column = dgtk.add_toggle_column(self.file_view, "DL?", 0)
|
self.filetoggle_column = dgtk.add_toggle_column(self.file_view, _("Download"), 0)
|
||||||
|
|
||||||
self.filename_column.set_expand(True)
|
self.filename_column.set_expand(True)
|
||||||
|
|
||||||
@ -447,7 +446,7 @@ class DelugeGTK(dbus.service.Object):
|
|||||||
for torrent_file in self.torrent_file_queue:
|
for torrent_file in self.torrent_file_queue:
|
||||||
print "adding torrent", torrent_file
|
print "adding torrent", torrent_file
|
||||||
try:
|
try:
|
||||||
self.manager.add_torrent(torrent_file, ".", True)
|
interactive_add_torrent(torrent_file)
|
||||||
except deluge.DelugeError:
|
except deluge.DelugeError:
|
||||||
print "duplicate torrent found, ignoring", torrent_file
|
print "duplicate torrent found, ignoring", torrent_file
|
||||||
## add torrents in manager to interface
|
## add torrents in manager to interface
|
||||||
@ -628,11 +627,11 @@ class DelugeGTK(dbus.service.Object):
|
|||||||
self.interactive_add_torrent(torrent)
|
self.interactive_add_torrent(torrent)
|
||||||
|
|
||||||
def add_torrent_url_clicked(self, obj=None):
|
def add_torrent_url_clicked(self, obj=None):
|
||||||
dlg = gtk.Dialog(title="Add torrent from URL", parent=self.window,
|
dlg = gtk.Dialog(title=_("Add torrent from URL"), parent=self.window,
|
||||||
buttons=(gtk.STOCK_CANCEL, 0, gtk.STOCK_OK, 1))
|
buttons=(gtk.STOCK_CANCEL, 0, gtk.STOCK_OK, 1))
|
||||||
dlg.set_icon_from_file(dcommon.get_pixmap("deluge32.png"))
|
dlg.set_icon_from_file(dcommon.get_pixmap("deluge32.png"))
|
||||||
|
|
||||||
label = gtk.Label("Enter the URL of the .torrent to download")
|
label = gtk.Label(_("Enter the URL of the .torrent to download"))
|
||||||
entry = gtk.Entry()
|
entry = gtk.Entry()
|
||||||
dlg.vbox.pack_start(label)
|
dlg.vbox.pack_start(label)
|
||||||
dlg.vbox.pack_start(entry)
|
dlg.vbox.pack_start(entry)
|
||||||
@ -670,7 +669,7 @@ class DelugeGTK(dbus.service.Object):
|
|||||||
if not args.get_active():
|
if not args.get_active():
|
||||||
warning.set_text(" ")
|
warning.set_text(" ")
|
||||||
else:
|
else:
|
||||||
warning.set_markup("<i>" + "Warning - all downloaded files for this torrent will be deleted!" + "</i>")
|
warning.set_markup("<i>" + _("Warning - all downloaded files for this torrent will be deleted!") + "</i>")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def update_tracker(self, obj=None):
|
def update_tracker(self, obj=None):
|
||||||
|
@ -30,15 +30,15 @@ import gtk.glade
|
|||||||
|
|
||||||
## Browse for .torrent files
|
## Browse for .torrent files
|
||||||
def show_file_open_dialog(parent=None):
|
def show_file_open_dialog(parent=None):
|
||||||
chooser = gtk.FileChooserDialog("Choose a .torrent file", parent, gtk.FILE_CHOOSER_ACTION_OPEN,
|
chooser = gtk.FileChooserDialog(_("Choose a .torrent file"), parent, gtk.FILE_CHOOSER_ACTION_OPEN,
|
||||||
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))
|
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK))
|
||||||
|
|
||||||
f0 = gtk.FileFilter()
|
f0 = gtk.FileFilter()
|
||||||
f0.set_name(".torrent files")
|
f0.set_name(_("Torrent files"))
|
||||||
f0.add_pattern("*." + "torrent")
|
f0.add_pattern("*." + "torrent")
|
||||||
chooser.add_filter(f0)
|
chooser.add_filter(f0)
|
||||||
f1 = gtk.FileFilter()
|
f1 = gtk.FileFilter()
|
||||||
f1.set_name("All files")
|
f1.set_name(_("All files"))
|
||||||
f1.add_pattern("*")
|
f1.add_pattern("*")
|
||||||
chooser.add_filter(f1)
|
chooser.add_filter(f1)
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ def show_file_open_dialog(parent=None):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
def show_directory_chooser_dialog(parent=None):
|
def show_directory_chooser_dialog(parent=None):
|
||||||
chooser = gtk.FileChooserDialog("Choose a download directory", parent, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
|
chooser = gtk.FileChooserDialog(_("Choose a download directory"), parent, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
|
||||||
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK))
|
buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_OK))
|
||||||
if chooser.run() == gtk.RESPONSE_OK:
|
if chooser.run() == gtk.RESPONSE_OK:
|
||||||
result = chooser.get_filename()
|
result = chooser.get_filename()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user