From 425af00ebf45b3d364c6b0bccb589b5749f599b6 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 30 Nov 2016 20:40:10 +0000 Subject: [PATCH] [GTKUI] Fix the translation of tracker status --- deluge/ui/common.py | 12 ++++++------ deluge/ui/gtkui/tab_data_funcs.py | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/deluge/ui/common.py b/deluge/ui/common.py index fc0fdd653..38848c8bf 100644 --- a/deluge/ui/common.py +++ b/deluge/ui/common.py @@ -91,12 +91,12 @@ TORRENT_DATA_FIELD = { } -TRACKER_STATUS_TRANSLATION = { - 'Error': _('Error'), - 'Warning': _('Warning'), - 'Announce OK': _('Announce OK'), - 'Announce Sent': _('Announce Sent') -} +TRACKER_STATUS_TRANSLATION = [ + _('Error'), + _('Warning'), + _('Announce OK'), + _('Announce Sent') +] del _ DEFAULT_HOST = '127.0.0.1' diff --git a/deluge/ui/gtkui/tab_data_funcs.py b/deluge/ui/gtkui/tab_data_funcs.py index fcf2249b2..39f755a2e 100644 --- a/deluge/ui/gtkui/tab_data_funcs.py +++ b/deluge/ui/gtkui/tab_data_funcs.py @@ -8,6 +8,7 @@ # from deluge.common import fdate, fsize, fspeed, ftime +from deluge.ui.common import TRACKER_STATUS_TRANSLATION def ftotal_sized(first, second): @@ -82,8 +83,13 @@ def fcount(value): def ftranslate(text): - if text: + if text in TRACKER_STATUS_TRANSLATION: text = _(text) + elif text: + for status in TRACKER_STATUS_TRANSLATION: + if status in text: + text = text.replace(status, _(status)) + break return text