add chinese support
This commit is contained in:
@@ -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'''
|
||||
|
||||
Reference in New Issue
Block a user