def get_format(accept): # By default use the computer's locale if accept is None: accept = get_accept() # Negotiate language = accept.select_language(available_languages) if language is None: language = 'en' # The format return formats[language]
def get_format(source, accept): # By default use the computer's locale if accept is None: accept = get_accept() # Negotiate available_languages = source.keys() language = accept.select_language(available_languages) if language is None: language = 'en' # The format return source[language]