View Source I18nHelpers.Plugs.PutLocaleFromSubdomain (I18n Helpers v0.14.0)
Plug to fetch the locale from the URL's subdomain; assigns the locale to the Connection and sets the Gettext locale.
This plug is useful if you have URLs similar to:
https://fr.example.com/bonjour
https://nl.example.com/hallo
https://es.example.com/hola
https://example.com/hello (default locale "en")Options
:default_locale- locale to be used if no locale was found in the URL:allowed_locales- a list of allowed locales. If no locale was found, use the:default localeif specified, otherwise raise an error.
Summary
Functions
@spec call( Plug.Conn.t(), keyword() ) :: Plug.Conn.t()