Routex.Extension.Localize.Phoenix.Extractor (Routex v1.2.2)
View SourceExtracts locale information from various sources. Handles both Plug.Conn
structs and map inputs.
Supports languages and regions defined in the IANA Language Subtag Registry
Sources
List of sources to examine for this field.
:accept_language
examines theaccept-language
header.:body
usesbody_params
; useful when using values in API bodies.:cookie
uses the request cookie(s):host
examines the hostname e.gen.example.com
andexample.nl
. Returns the first match..:path
usespath_params
such as/:locale/products/
:query
usesquery_params
such as/products?locale=en-US
:route
uses the (precompiled) route attributes.:session
uses the session:assigns
uses the assigns stored in connection of socket
Params
List of keys in a source to examine. Defaults to the name of the field with
fallback to locale
.