Localize.PhoenixRuntime.Extractor (localize_phoenix_runtime v0.1.0-alpha.1)
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.:attrs
uses the (precompiled) route atributes.: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
: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
.