Sha256: 85e3ea8a06022bb07077a773fccdc841462afefb192bb2d50be2207ff4b1bccf

Contents?: true

Size: 241 Bytes

Versions: 108

Compression:

Stored size: 241 Bytes

Contents

class Locale
  def initialize(app)
    @app = app
  end

  def call(env)
    req = Rack::Request.new(env)
    I18n.locale = req.params['locale'] || :en
    status, headers, response = @app.call(env)
    [status, headers, response]
  end
end

Version data entries

108 entries across 108 versions & 1 rubygems

Version Path
web_translate_it-1.6.7 examples/locale.rb
web_translate_it-1.6.6 examples/locale.rb
web_translate_it-1.6.5 examples/locale.rb
web_translate_it-1.6.4 examples/locale.rb
web_translate_it-1.6.3 examples/locale.rb
web_translate_it-1.6.2 examples/locale.rb
web_translate_it-1.6.1 examples/locale.rb
web_translate_it-1.6.0 examples/locale.rb