No commit activity in last 3 years
No release in over 3 years
http accept language handler
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.10.3
~> 0.6.3
>= 3.3.0, ~> 3.3
~> 0.38.0
 Project Readme

RackHttpAcceptLanguage

Build Status Gem Version

Possible Methods

You have two methods on the env object:

rack_http_accept_lanugage

and

rack_http_accept_lanugages

How you can use it with Sinatra

class App < Sinatra::Base
  use RackHttpAcceptLanguage::Middleware

  post '/' do
    I18n.locale = request.env.rack_http_accept_language
  end
end

How you use it with Rails

Add the following line to your application.rb

config.middleware.use RackHttpAcceptLanguage::Middleware

Installation

Add the gem to your Gemfile:

gem 'rack-http-accept-language'

Run bundle install to install it.

License

RackHttpAcceptLanguage is released under the MIT License.