using and exporting source and explanation

pull/1/head
Ozbolt Menegatti 4 years ago
parent c5c4d9b10a
commit 78a80c03a7

@ -103,8 +103,13 @@ def export_translation(doc, translation):
actual_t = doc.createElement("translation")
actual_t.textContent = translation.translation
actual_t.setAttribute("source", translation.source)
translation_xml.appendChild(actual_t)
explanation = doc.createElement("explanation")
explanation.textContent = translation.explanation
translation_xml.appendChild(explanation)
tags = doc.createElement("tagsContainer")
translation_xml.appendChild(tags)

@ -10,6 +10,10 @@ class Translation:
def __init__(self, translation_xml):
translation = translation_xml.querySelector("translation")
self.translation = translation.textContent if translation else ""
self.source = translation.getAttribute("source") or ""
explanation = translation_xml.querySelector("explanation")
self.explanation = explanation.textContent if explanation else ""
self.tags = {}
for tag_xml in translation_xml.querySelectorAll("tagsContainer tag"):

Loading…
Cancel
Save