Example translation editing

This commit is contained in:
2019-11-16 14:18:37 +01:00
parent 4a80ba878a
commit e287e2414a
8 changed files with 62 additions and 9 deletions

View File

@@ -1,8 +1,10 @@
class Example:
from model.editable import Editable
class Example(Editable):
def __init__(self, example_xml):
example = example_xml.querySelector("example")
translation = example_xml.querySelector("translationContainer translation")
self.example = example.textContent if example else ""
self.translation = translation.textContent if translation else ""
self.translations = []
for translation in example_xml.querySelectorAll("translationContainer translation"):
self.translations.append(translation.textContent)