mirror of
https://github.com/chubin/wttr.in.git
synced 2024-10-05 01:42:07 +02:00
added find_supported_language()
This commit is contained in:
parent
3a5335ff0c
commit
e120196259
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user