def negotiate_locale_name(request):
 try:
  registry = request.registry
 except AttributeError:
  registry = get_current_registry()
 negotiator = registry.queryUtility(ILocaleNegotiator, default=default_locale_negotiator)
 locale_name = negotiator(request)
 if (locale_name is None):
  settings = (registry.settings or {})
  locale_name = settings.get('default_locale_name', 'en')
 return locale_name

def negotiate_locale_name ( request ) : try : registry = request . registry except AttributeError : registry = get_current_registry ( ) negotiator = registry . queryUtility ( ILocaleNegotiator , default = default_locale_negotiator ) locale_name = negotiator ( request ) if ( locale_name is None ) : settings = ( registry . settings or { } ) locale_name = settings . get ( 'default_locale_name' , 'en' ) return locale_name
negotiate and return the :term:locale name associated with the current request .