mirror of
https://github.com/chubin/wttr.in
synced 2024-11-14 16:17:19 +00:00
added find_supported_language()
This commit is contained in:
parent
3a5335ff0c
commit
e120196259
1 changed files with 9 additions and 0 deletions
|
@ -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 a new issue