class Marten::Template::ContextProducer::I18n

Overview

Context producer that adds the current locale and the availables locales to the context.

The current locale is exposed as a locale variable while the available locales are exposed as an available_locales variable.

Defined in:

marten/template/context_producer/i18n.cr

Instance Method Summary

Instance methods inherited from class Marten::Template::ContextProducer

produce(request : HTTP::Request | Nil = nil) produce

Instance Method Detail

def produce(request : HTTP::Request | Nil = nil) #
Description copied from class Marten::Template::ContextProducer

Returns a hash of values to include in a template context.

The method must return a hash or named tuple if there are values to return, otherwise it can also return nil if it can't produce any values.


[View source]