mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
don't error when -l passes in language without _
This commit is contained in:
parent
e29d380d4c
commit
ea3c6cad42
1 changed files with 5 additions and 1 deletions
|
@ -133,7 +133,11 @@ def lang_to_disk_lang(lang: str) -> str:
|
|||
):
|
||||
return lang.replace("_", "-")
|
||||
# other languages have the region portion stripped
|
||||
return re.match("(.*)_", lang).group(1)
|
||||
m = re.match("(.*)_", lang)
|
||||
if m:
|
||||
return m.group(1)
|
||||
else:
|
||||
return lang
|
||||
|
||||
|
||||
# the currently set interface language
|
||||
|
|
Loading…
Reference in a new issue