Skip to content

Commit 1fcbac8

Browse files
committed
quick support for lang attribute on place name
1 parent 3e94b70 commit 1fcbac8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lxml/lxmlGramplet.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,12 @@ def ParseXML(self, tree, filename):
423423

424424
if three.tag == NAMESPACE + 'pname':
425425
text = str(three.attrib.get('value'))
426+
translation = str(three.attrib.get('lang'))
427+
if translation == 'None':
428+
translation = xml_lang()[0:2]
429+
text = text + _(' - (? or %(lang)s)') % {'lang':translation}
430+
else:
431+
text = text + _(' - (%(lang)s)') % {'lang':translation}
426432
if text not in places:
427433
places.append(text) # temp display
428434
if three.tag == NAMESPACE + 'stitle' and three.text not in sources:

0 commit comments

Comments
 (0)