Cldr v2.6.0 Cldr.Plug.AcceptLanguage 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

Example

plug Cldr.Plug.AcceptLanguage,
  cldr_backend: MyApp.Cldr

Link to this section Summary

Functions

Returns the locale which is the best match for the provided accept-language header

Link to this section Functions

Link to this function

best_match(accept_language, backend) View Source

Returns the locale which is the best match for the provided accept-language header

Return the locale set by Cldr.Plug.AcceptLanguage