No commit activity in last 3 years
No release in over 3 years
Track a user's last locale with Devise.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

> 3.0
 Project Readme

devise-track_locale

Adds support to Devise for remembering a user's last locale.

Installation

Add the folling lines to your Gemfile:

# Remember the locale on user visits
gem "devise-track_locale"

Usage

Add a locale attribute to your users:

$ rails g migration AddLocaleToUsers locale
$ rake db:migrate

Save the locale on every sign-in

In your model, add :track_locale as a devise module:

class User < ActiveRecord::Base
  devise , :track_locale
end

Save the locale only once

In your model, add :track_default_locale as a devise module:

class User < ActiveRecord::Base
  devise , :track_default_locale
end

Copyright

By Sunny Ripert, under the MIT License. See LICENSE for details.