I18n Helpers v0.5.3 I18nHelpers.Plugs.PutLocaleFromSubdomain View Source

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 locale if specified, otherwise raise an error.

Link to this section Summary

Link to this section Functions