Sha256: 1ba29e694cf54097ef5b92d5c2e065832ffba9bf8ca20503dfc244b26a6b1097

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

# RackHttpAcceptLanguage
[![Build Status](https://travis-ci.org/kaeuferportal/rack-http-accept-language.svg?branch=master)](https://travis-ci.org/kaeuferportal/rack-http-accept-language)
[![Gem Version](https://badge.fury.io/rb/rack-http-accept-language.svg)](https://badge.fury.io/rb/rack-http-accept-language)

## 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

``` ruby
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``
``` ruby
config.middleware.use RackHttpAcceptLanguage::Middleware
```

## Installation

Add the gem to your Gemfile:

``` ruby
gem 'rack-http-accept-language'
```

Run `bundle install` to install it.

## License

RackHttpAcceptLanguage is released under the [MIT License](http://www.opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-http-accept-language-0.1.1 README.md