added find_supported_language()

This commit is contained in:
Igor Chubin 2018-10-03 19:38:33 +02:00
parent 3a5335ff0c
commit e120196259

View File

@ -265,6 +265,15 @@ def location_canonical_name( location ):
return location_alias[location.lower()]
return location
def find_supported_language(accepted_languages):
for p in accepted_languages:
lang = p[0]
if '-' in lang:
lang = lang.split('-',1)[0]
if lang in SUPPORTED_LANGS:
return lang
return None
def show_help():
return open(HELP_FILE, 'r').read()