Module accept_language

Module accept_language 

Source
Expand description

Parser for an Accept-Language HTTP header.

Structs§

AcceptLanguage
Stores a parsed version of an HTTP Accept-Language header.
Item 🔒
LanguageTags
A list of BCP47 language tags.
Weight 🔒

Enums§

AcceptLanguageError 🔒
Errors when parsing an AcceptLanguage.
Language
Used to set the language for rendering.
UserLanguage
Language but with the environment’s locale converted to something we can use.

Constants§

OWS 🔒
Optional whitespace, Space or Tab, per RFC 7230.

Functions§

get_language_tags_from_environment 🔒
Gets language tags from the environment.
locale_from_environment 🔒
Gets the user’s preferred locale from the environment and translates it to a Locale with LanguageRange fallbacks.