This commit is contained in:
Kovid Goyal 2022-06-20 14:12:12 +05:30
parent 584456876d
commit e111569c99
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1903,7 +1903,10 @@ class OEBBook:
return
def _to_ncx(self):
lang = str(self.metadata.language[0])
try:
lang = str(self.metadata.language[0])
except IndexError:
lang = 'en'
lang = lang.replace('_', '-')
ncx = etree.Element(NCX('ncx'),
attrib={'version': '2005-1', XML('lang'): lang},