Sha256: 755d72215f98d58f700d3c1410537bfb4750d7fc8749f791431b9a9bcf7f6636

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

= rails_locale_detection

Sets the current locale of a request using a combination of params, cookies, and http headers. 

In turn, it checks the value of params[:locale], cookies[:locale] and finally HTTP_ACCEPT_LANGUAGE headers to find a locale that
corresponds to the available locales, then stores the set locale in a cookie for future requests.

== Usage

Include the gem in your Gemfile 

  gem 'rails_locale_detection'
  
Set your default and available locales

  I18n.default_locale = :en
  I18n.available_locales = [:en, :fr]
  
Call set_locale as a filter in your controllers

  class ApplicationController < ActionController::Base
    before_filter :set_locale
    
  end

== Contributing to rails_locale_detection
 
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

== Copyright

Copyright (c) 2011 Mateo Murphy. See LICENSE.txt for
further details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_locale_detection-1.0.0 README.rdoc