plug_preferred_locales v0.1.0 PlugPreferredLocales
PlugPreferredLocales is a plug to parse the "accept-language"
header and
store a list of preferred locales in the :private
key of the
%Plug.Conn{}
.
Options
The following options are supported:
:ignore_area
- Determines wether to ignore the area part of a locale. This would cause the preferred localeen-US
to be listed solely asen
.
Link to this section Summary
Link to this section Types
Link to this section Functions
Parses the accept header (if exists).
It returns a list of language tags ordered by the quality factor.
Link to this function
parse_language_range(language_range)
Parses a language range.
Returns a tuple with the language tag as the first element and the quality
as the second. If no quality is specified it uses 1.0
.