summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2016-11-30 13:26:34 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2016-11-30 13:29:33 +0000
commit0b4627be8aa7184eb08a7d9af72784e1b0f0523d (patch)
tree7d9bd5ba3850a3cd9852eb1ec1b34768cff1b4db
parent739537f860892e2f526e8416ae53ab08ff9fc47b (diff)
downloaddeluge-0b4627be8aa7184eb08a7d9af72784e1b0f0523d.tar.gz
deluge-0b4627be8aa7184eb08a7d9af72784e1b0f0523d.tar.bz2
deluge-0b4627be8aa7184eb08a7d9af72784e1b0f0523d.zip
[#2941] Remove tracker_status translation markup from core
* A UnicodeDecodeError can occur if creating a string using translated text but we should not be translating anything in core anyway so remove the markup and do the translating in UI.
-rw-r--r--deluge/core/filtermanager.py2
-rw-r--r--deluge/core/torrentmanager.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/deluge/core/filtermanager.py b/deluge/core/filtermanager.py
index d72b82fb6..160b0c475 100644
--- a/deluge/core/filtermanager.py
+++ b/deluge/core/filtermanager.py
@@ -91,7 +91,7 @@ def tracker_error_filter(torrent_ids, values):
# Check all the torrent's tracker_status for 'Error:' and only return torrent_ids
# that have this substring in their tracker_status
for torrent_id in torrent_ids:
- if _("Error") + ":" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
+ if "Error:" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
filtered_torrent_ids.append(torrent_id)
return filtered_torrent_ids
diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py
index 9d88d8317..abd35e328 100644
--- a/deluge/core/torrentmanager.py
+++ b/deluge/core/torrentmanager.py
@@ -1014,7 +1014,7 @@ class TorrentManager(component.Component):
# Set the tracker status for the torrent
if alert.message() != "Got peers from DHT":
- torrent.set_tracker_status(_("Announce OK"))
+ torrent.set_tracker_status("Announce OK")
# Check to see if we got any peer information from the tracker
if alert.handle.status().num_complete == -1 or \
@@ -1030,7 +1030,7 @@ class TorrentManager(component.Component):
return
# Set the tracker status for the torrent
- torrent.set_tracker_status(_("Announce Sent"))
+ torrent.set_tracker_status("Announce Sent")
def on_alert_tracker_warning(self, alert):
log.debug("on_alert_tracker_warning")
@@ -1038,7 +1038,7 @@ class TorrentManager(component.Component):
torrent = self.torrents[str(alert.handle.info_hash())]
except:
return
- tracker_status = '%s: %s' % (_("Warning"), decode_string(alert.message()))
+ tracker_status = '%s: %s' % ("Warning", decode_string(alert.message()))
# Set the tracker status for the torrent
torrent.set_tracker_status(tracker_status)
@@ -1055,7 +1055,7 @@ class TorrentManager(component.Component):
except (RuntimeError, KeyError):
return
- torrent.set_tracker_status("%s: %s" % (_("Error"), error_message))
+ torrent.set_tracker_status("Error: %s" % error_message)
def on_alert_storage_moved(self, alert):
log.debug("on_alert_storage_moved")