Fix issue with setting subelements values with default langs.
This commit is contained in:
parent
2a78570d65
commit
1ad171dfe5
1 changed files with 4 additions and 4 deletions
|
@ -1003,11 +1003,11 @@ class ElementBase(object):
|
|||
last_xml = element
|
||||
element = last_xml
|
||||
|
||||
if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang:
|
||||
element = ET.Element(ename)
|
||||
if lang:
|
||||
if lang:
|
||||
if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang:
|
||||
element = ET.Element(ename)
|
||||
element.attrib['{%s}lang' % XML_NS] = lang
|
||||
parent.append(element)
|
||||
parent.append(element)
|
||||
|
||||
element.text = text
|
||||
return element
|
||||
|
|
Loading…
Reference in a new issue