Commit d5e52530 authored by 林檎's avatar 林檎

Lower case text, some epub have uppercased which is beyond iso639 standard.

parent 13b4ae4c
...@@ -51,6 +51,7 @@ def get_epub_info(tmp_file_path, original_file_name, original_file_extension): ...@@ -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 try:#maybe dc:language isn't present, less possible but possible
lang = p.xpath('dc:language/text()', namespaces=ns)[0] lang = p.xpath('dc:language/text()', namespaces=ns)[0]
lang = lang.split('-', 1)[0] lang = lang.split('-', 1)[0]
lang.lower()
if len(lang) == 2: if len(lang) == 2:
epub_metadata['languages'] = isoLanguages.get(part1=lang).name epub_metadata['languages'] = isoLanguages.get(part1=lang).name
elif len(lang) == 3: elif len(lang) == 3:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment