mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
[GTKUI] Fix the translation of tracker status
This commit is contained in:
parent
373c8a14b0
commit
425af00ebf
2 changed files with 13 additions and 7 deletions
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue