From d5e525305df9cd021abbe46eae9ed94878244edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E6=AA=8E?= Date: Thu, 2 Mar 2017 23:20:37 +0800 Subject: [PATCH] Lower case text, some epub have uppercased which is beyond iso639 standard. --- cps/epub.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cps/epub.py b/cps/epub.py index 2393c256..6e42add9 100644 --- a/cps/epub.py +++ b/cps/epub.py @@ -51,6 +51,7 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): try:#maybe dc:language isn't present, less possible but possible lang = p.xpath('dc:language/text()', namespaces=ns)[0] lang = lang.split('-', 1)[0] + lang.lower() if len(lang) == 2: epub_metadata['languages'] = isoLanguages.get(part1=lang).name elif len(lang) == 3: