lexonomy_custom_editor/src/model/translation.py

11 lines
479 B
Python
Raw Normal View History

2019-11-05 21:18:20 +00:00
class Translation:
def __init__(self, translation_xml):
translation = translation_xml.querySelector("translation")
self.translation = translation.textContent if translation else ""
self.tags = {}
for tag_xml in translation_xml.querySelectorAll("tagsContainer tag"):
t_type = tag_xml.querySelector("type").textContent
t_value = tag_xml.querySelector("value").textContent
self.tags[t_type] = t_value