Cldr.Plug.AcceptLanguage (Cldr v2.26.0) View Source
Parses the accept-language header if one is available and sets
conn.private[:cldr_locale] accordingly.  The locale can
be later retrieved by Cldr.Plug.AcceptLanguage.get_cldr_locale/1
Options
- :cldr_backendis any backend module. The default is- Cldr.default_backend/0. If no- :cldr_backendoption is provided and no default backend is configured then an exception will be raised.
- :no_match_log_leveldetermines the logging level for the case when no matching locale is configured to meet the users request. The default is- :warn. If set to- nilthen no logging is performed.
Example
# Using a specific backend to validate
# and match locales
plug Cldr.Plug.AcceptLanguage,
  cldr_backend: MyApp.Cldr
# Using the default backend to validate
# and match locales
plug Cldr.Plug.AcceptLanguageLink to this section Summary
Functions
Returns the locale which is the best match for the provided accept-language header
Return the locale set by Cldr.Plug.AcceptLanguage
Link to this section Functions
Returns the locale which is the best match for the provided accept-language header
Return the locale set by Cldr.Plug.AcceptLanguage
