Class: Locomotive::Steam::Server::Locale

Inherits:
Middleware
  • Object
show all
Defined in:
lib/locomotive/steam/server/locale.rb

Overview

Set the locale from the path if possible or use the default one Examples:

/fr/index   => locale = :fr
/fr/        => locale = :fr
/index      => locale = :en (default one)

Instance Attribute Summary

Attributes inherited from Middleware

#app, #content_entry, #liquid_assigns, #mounting_point, #page, #path, #request

Instance Method Summary collapse

Methods inherited from Middleware

#initialize

Constructor Details

This class inherits a constructor from Locomotive::Steam::Server::Middleware

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/locomotive/steam/server/locale.rb', line 12

def call(env)
  self.set_accessors(env)

  self.set_locale!(env)

  app.call(env)
end