11 lines
479 B
Python
11 lines
479 B
Python
|
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
|