add chinese support

This commit is contained in:
lizhi-rocky
2010-08-04 13:29:48 +08:00
parent fb7d3283c2
commit 4ad1c428e0
8 changed files with 277 additions and 62 deletions

View File

@@ -169,6 +169,22 @@ class Sequence:
Sequence.current_sequence.current_step += 1
return Sequence.current_sequence.steps[Sequence.current_sequence.current_step]
class Text:
''' implement text in interface.xml '''
dict={}
def __init__(self, xml_node):
for n in xml_node.childNodes:
if n.nodeType == n.ELEMENT_NODE:
if n.nodeName == 'English': self.english = n.firstChild.data
elif n.nodeName == 'Chinese': self.chinese = n.firstChild.data
if 'key' in xml_node.attributes.keys():
self.key = xml_node.attributes['key'].value
else:
self.key = self.english
Text.dict[self.key.lower()] = self
def construct(xml_root):
''' construct Widget's static members'''
for n in xml_root.childNodes:
@@ -177,6 +193,7 @@ def construct(xml_root):
elif n.nodeName == "message_box": MessageBox(n)
elif n.nodeName == "top_window": TopWindow(n)
elif n.nodeName == "sequence": Sequence(n)
elif n.nodeName == "text": Text(n)
def init_display(bw):
''' base widget name'''