def find_supported(ranked):
 langs = dict(settings.LANGUAGE_URL_MAP)
 for (lang, _) in ranked:
  lang = lang.lower()
  if (lang in langs):
   return langs[lang]
  pre = '-'.join(lang.split('-')[0:(-1)])
  if pre:
   ranked.append((pre, None))
 return False

def find_supported ( ranked ) : langs = dict ( settings . LANGUAGE_URL_MAP ) for ( lang , _ ) in ranked : lang = lang . lower ( ) if ( lang in langs ) : return langs [ lang ] pre = '-' . join ( lang . split ( '-' ) [ 0 : ( - 1 ) ] ) if pre : ranked . append ( ( pre , None ) ) return False
given a ranked language list .