mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix bug in iana2mobi() function.
This commit is contained in:
parent
23d17f0a66
commit
9e53eeba78
@ -305,8 +305,8 @@ IANA_MOBI = \
|
|||||||
'TW': (4, 4)},
|
'TW': (4, 4)},
|
||||||
'zu': {None: (53, 0)}}
|
'zu': {None: (53, 0)}}
|
||||||
|
|
||||||
def iana2mobi(self, icode):
|
def iana2mobi(icode):
|
||||||
subtags = list(code.split('-'))
|
subtags = list(icode.split('-'))
|
||||||
langdict = IANA_MOBI[None]
|
langdict = IANA_MOBI[None]
|
||||||
while len(subtags) > 0:
|
while len(subtags) > 0:
|
||||||
lang = subtags.pop(0).lower()
|
lang = subtags.pop(0).lower()
|
||||||
@ -316,6 +316,8 @@ def iana2mobi(self, icode):
|
|||||||
mcode = langdict[None]
|
mcode = langdict[None]
|
||||||
while len(subtags) > 0:
|
while len(subtags) > 0:
|
||||||
subtag = subtags.pop(0)
|
subtag = subtags.pop(0)
|
||||||
|
if subtag not in langdict:
|
||||||
|
subtag = subtag.title()
|
||||||
if subtag not in langdict:
|
if subtag not in langdict:
|
||||||
subtag = subtag.upper()
|
subtag = subtag.upper()
|
||||||
if subtag in langdict:
|
if subtag in langdict:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user