mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +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 = {
|
TRACKER_STATUS_TRANSLATION = [
|
||||||
'Error': _('Error'),
|
_('Error'),
|
||||||
'Warning': _('Warning'),
|
_('Warning'),
|
||||||
'Announce OK': _('Announce OK'),
|
_('Announce OK'),
|
||||||
'Announce Sent': _('Announce Sent')
|
_('Announce Sent')
|
||||||
}
|
]
|
||||||
del _
|
del _
|
||||||
|
|
||||||
DEFAULT_HOST = '127.0.0.1'
|
DEFAULT_HOST = '127.0.0.1'
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
from deluge.common import fdate, fsize, fspeed, ftime
|
from deluge.common import fdate, fsize, fspeed, ftime
|
||||||
|
from deluge.ui.common import TRACKER_STATUS_TRANSLATION
|
||||||
|
|
||||||
|
|
||||||
def ftotal_sized(first, second):
|
def ftotal_sized(first, second):
|
||||||
|
@ -82,8 +83,13 @@ def fcount(value):
|
||||||
|
|
||||||
|
|
||||||
def ftranslate(text):
|
def ftranslate(text):
|
||||||
if text:
|
if text in TRACKER_STATUS_TRANSLATION:
|
||||||
text = _(text)
|
text = _(text)
|
||||||
|
elif text:
|
||||||
|
for status in TRACKER_STATUS_TRANSLATION:
|
||||||
|
if status in text:
|
||||||
|
text = text.replace(status, _(status))
|
||||||
|
break
|
||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue