mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
fix script variante includes in the lang_code
Some dictionaries add a script variante in their lang_code, for example: https://github.com/LibreOffice/dictionaries/tree/master/mn_MN
This commit is contained in:
parent
a43d86a0af
commit
8374353d51
@ -23,6 +23,9 @@ def parse_lang_code(raw):
|
||||
if lc is None:
|
||||
raise ValueError('Invalid language code: %r' % raw)
|
||||
cc = None
|
||||
for sc in ['Cyrl', 'Latn']:
|
||||
if sc in parts:
|
||||
parts.remove(sc)
|
||||
if len(parts) > 1:
|
||||
ccodes, ccodemap = get_codes()[:2]
|
||||
q = parts[1].upper()
|
||||
|
Loading…
x
Reference in New Issue
Block a user