summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2012-03-11 17:10:32 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2012-03-11 17:13:25 +0000
commitc194f6bbe4c60e93b0dbcab25eec381d5fb485c4 (patch)
treefb503473fc5264722247332713fa85d11dfef376
parent4d77241603ecf8b6c687bbc15a19598a85d3a767 (diff)
downloaddeluge-c194f6bbe4c60e93b0dbcab25eec381d5fb485c4.zip
deluge-c194f6bbe4c60e93b0dbcab25eec381d5fb485c4.tar.gz
deluge-c194f6bbe4c60e93b0dbcab25eec381d5fb485c4.tar.bz2
Fix #2052 : Progress bar state text marked for deferred translation
-rw-r--r--deluge/ui/gtkui/torrentview.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py
index 8d2aa1f..9617832 100644
--- a/deluge/ui/gtkui/torrentview.py
+++ b/deluge/ui/gtkui/torrentview.py
@@ -79,6 +79,24 @@ ICON_STATE = {
"Checking Resume Data": icon_checking
}
+def _(message): return message
+
+TRANSLATE = {
+ "Downloading": _("Downloading"),
+ "Seeding": _("Seeding"),
+ "Paused": _("Paused"),
+ "Checking": _("Checking"),
+ "Queued": _("Queued"),
+ "Error": _("Error"),
+}
+
+del _
+
+def _t(text):
+ if text in TRANSLATE:
+ text = TRANSLATE[text]
+ return _(text)
+
def cell_data_statusicon(column, cell, model, row, data):
"""Display text with an icon"""
try:
@@ -130,7 +148,7 @@ def cell_data_progress(column, cell, model, row, data):
if cell.get_property("value") != value:
cell.set_property("value", value)
- textstr = "%s" % state_str
+ textstr = _t(state_str)
if state_str != "Seeding" and value < 100:
textstr = textstr + " %.2f%%" % value
if cell.get_property("text") != textstr: