adjusted extract_locale_from_accept_language_header