When updating metadata in EPUB 2 files and no language is specified, do not remove the <dc:language> tag as this causes epubcheck to complain. Instead set the language to "und". Fixes #2004522 [sendtokindle fails after editing](https://bugs.launchpad.net/calibre/+bug/2004522)

This commit is contained in:
Kovid Goyal 2023-02-02 15:01:34 +05:30
parent 4684c87497
commit 3b9fd595b4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1106,9 +1106,14 @@ class OPF: # {{{
for x in matches:
x.getparent().remove(x)
num_done = 0
for lang in val:
l = self.create_metadata_element('language')
self.set_text(l, str(lang))
num_done += 1
if num_done == 0:
l = self.create_metadata_element('language')
self.set_text(l, 'und')
@property
def raw_languages(self):