Marten::Middleware::I18n
Inherits Marten::Middleware / Reference / Object
Activates the right I18n locale based on the incoming requests.
This middleware will activate the right locale based on the Accept-Language header. Only explicitly-configured
locales can be activated by this middleware (that is, locales that are specified in the
Marten.settings.i18n.available_locales and Marten.settings.i18n.default_locale settings). If the incoming
locale can't be found in the project configuration, the default locale will be used instead.
Instance methods
Calls the middleware for a given HTTP request and returns a HTTP response.
This method must be implemented by subclasses: it takes a request argument (the current HTTP request) and a
get_response proc that allows to get the final response. This proc might actually call the next middleware in
the chain of configured middlewares, or the final matched handler. That way, the current middleware have the
ability to intercept any incoming request and the associated response, and to modify them if applicable.