[GTKUI] Fix the translation of tracker status

This commit is contained in:
Calum Lind 2016-11-30 20:40:10 +00:00
parent 373c8a14b0
commit 425af00ebf
2 changed files with 13 additions and 7 deletions

View File

@ -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'

View File

@ -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