required audio support #1351

This commit is contained in:
matic_t
2020-08-06 05:39:24 -07:00
parent 1770932a14
commit efe4d07464
3 changed files with 10 additions and 1 deletions

View File

@@ -26,6 +26,8 @@ def export_entry(entry):
headword_lemma.textContent = entry.headword
if entry.headword_type is not None:
headword_lemma.setAttribute("type", entry.headword_type)
if entry.headword_audio is not None:
headword_lemma.setAttribute("audio", entry.headword_audio)
headword.appendChild(headword_lemma)
head.appendChild(headword)
@@ -146,6 +148,9 @@ def export_translation(doc, translation):
actual_t.textContent = translation.translation
actual_t.setAttribute("targetLang", translation.targetLang)
if translation.audio:
actual_t.setAttribute("audio", translation.audio)
if translation.source:
actual_t.setAttribute("source", translation.source)
translation_xml.appendChild(actual_t)