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.9.0 examples/locale.rb
web_translate_it-1.8.4 examples/locale.rb
web_translate_it-1.8.3 examples/locale.rb
web_translate_it-1.8.2.3 examples/locale.rb
web_translate_it-1.8.2.2 examples/locale.rb
web_translate_it-1.8.2.1 examples/locale.rb
web_translate_it-1.8.2.0 examples/locale.rb
web_translate_it-1.8.1.9 examples/locale.rb
web_translate_it-1.8.1.8 examples/locale.rb
web_translate_it-1.8.1.7 examples/locale.rb
web_translate_it-1.8.1.6 examples/locale.rb
web_translate_it-1.8.1.5 examples/locale.rb
web_translate_it-1.8.1.4 examples/locale.rb
web_translate_it-1.8.1.3 examples/locale.rb
web_translate_it-1.8.1.2 examples/locale.rb
web_translate_it-1.8.1.1 examples/locale.rb
web_translate_it-1.8.1.0 examples/locale.rb
web_translate_it-1.8.0.1 examples/locale.rb
web_translate_it-1.8.0.0 examples/locale.rb
web_translate_it-1.7.3.1 examples/locale.rb