don't error when -l passes in language without _

This commit is contained in:
Damien Elmes 2020-03-25 08:53:31 +10:00
parent e29d380d4c
commit ea3c6cad42

View File

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