def locale_display_name(locale):
 if (not locale):
  raise KeyError
 if (locale.lower() in languages):
  v = languages[locale.lower()]
  return (v['English'], v['native'])
 else:
  hyphen = locale.rfind('-')
  if (hyphen == (-1)):
   raise KeyError
  else:
   return locale_display_name(locale[:hyphen])

def locale_display_name ( locale ) : if ( not locale ) : raise KeyError if ( locale . lower ( ) in languages ) : v = languages [ locale . lower ( ) ] return ( v [ 'English' ] , v [ 'native' ] ) else : hyphen = locale . rfind ( '-' ) if ( hyphen == ( - 1 ) ) : raise KeyError else : return locale_display_name ( locale [ : hyphen ] )
return for the locale .