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:
un-pogaz 2023-10-04 11:19:29 +02:00
parent a43d86a0af
commit 8374353d51

View File

@ -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()