Sha256: 007811c0187c8c506809663d43f62c37bfe8e9b0683b2a442eb8a01ef61ed551

Contents?: true

Size: 274 Bytes

Versions: 6

Compression:

Stored size: 274 Bytes

Contents

# frozen_string_literal: true

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

6 entries across 6 versions & 1 rubygems

Version Path
web_translate_it-3.1.1 examples/locale.rb
web_translate_it-3.1.0 examples/locale.rb
web_translate_it-3.0.2 examples/locale.rb
web_translate_it-3.0.1 examples/locale.rb
web_translate_it-3.0.0 examples/locale.rb
web_translate_it-3.0.0.beta1 examples/locale.rb