mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-13 21:14:55 +00:00
Fix #2052 : Progress bar state text marked for deferred translation
This commit is contained in:
parent
4d77241603
commit
c194f6bbe4
@ -79,6 +79,24 @@ ICON_STATE = {
|
|||||||
"Checking Resume Data": icon_checking
|
"Checking Resume Data": icon_checking
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def _(message): return message
|
||||||
|
|
||||||
|
TRANSLATE = {
|
||||||
|
"Downloading": _("Downloading"),
|
||||||
|
"Seeding": _("Seeding"),
|
||||||
|
"Paused": _("Paused"),
|
||||||
|
"Checking": _("Checking"),
|
||||||
|
"Queued": _("Queued"),
|
||||||
|
"Error": _("Error"),
|
||||||
|
}
|
||||||
|
|
||||||
|
del _
|
||||||
|
|
||||||
|
def _t(text):
|
||||||
|
if text in TRANSLATE:
|
||||||
|
text = TRANSLATE[text]
|
||||||
|
return _(text)
|
||||||
|
|
||||||
def cell_data_statusicon(column, cell, model, row, data):
|
def cell_data_statusicon(column, cell, model, row, data):
|
||||||
"""Display text with an icon"""
|
"""Display text with an icon"""
|
||||||
try:
|
try:
|
||||||
@ -130,7 +148,7 @@ def cell_data_progress(column, cell, model, row, data):
|
|||||||
if cell.get_property("value") != value:
|
if cell.get_property("value") != value:
|
||||||
cell.set_property("value", value)
|
cell.set_property("value", value)
|
||||||
|
|
||||||
textstr = "%s" % state_str
|
textstr = _t(state_str)
|
||||||
if state_str != "Seeding" and value < 100:
|
if state_str != "Seeding" and value < 100:
|
||||||
textstr = textstr + " %.2f%%" % value
|
textstr = textstr + " %.2f%%" % value
|
||||||
if cell.get_property("text") != textstr:
|
if cell.get_property("text") != textstr:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user