Plugs for putting locale into assigns
storage.
Add :plug_locale
to the list of dependencies in mix.exs
:
def deps do
[
{:plug_locale, <requirement>}
]
end
Different from set_locale
, ex_cldr_plugs
, etc, plug_locale
:
- only does one simple thing - setting a locale-related assign (by default, it is
conn.assigns.locale
). - does not make any assumptions about the localization strategy, so it is not tightly bound to packages like
gettext
orex_cldr
.
Check out PlugLocale.Browser
, PlugLocale.Header
in documentation for more details.
This library is built on the wisdom in following code:
Apache License 2.0