translate attributeID stuff

This commit is contained in:
cncfanatics
2010-10-19 10:38:34 +02:00
parent bc883685ec
commit e211970b5c

View File

@@ -309,12 +309,17 @@ class ItemParams (wx.Panel):
group = service.Market.getInstance().getGroup(value)
return "%s (%d)" % (group.name, value) if group is not None else str(value)
def attributeIDCallback():
attribute = service.Attribute.getInstance().getAttributeInfo(value)
return "%s (%d)" % (attribute.name.capitalize(), value)
trans = {"Inverse Absolute Percent": (lambda: (1-value)*100, unitName),
"Milliseconds": (lambda: value / 1000.0, unitName),
"Volume": (lambda: value, u"m\u00B3"),
"Sizeclass": (lambda: value, ""),
"typeID": (itemIDCallback, ""),
"groupID": (groupIDCallback,"")}
"groupID": (groupIDCallback,""),
"attributeID": (attributeIDCallback, "")}
override = trans.get(unitDisplayName)
if override is not None: