Update locale for signed in users

This commit is contained in:
Petko Bordjukov 2015-08-15 07:20:20 +03:00
parent b008f87684
commit 5cf2fc4ab1
1 changed files with 3 additions and 0 deletions

View File

@ -24,6 +24,9 @@ class ApplicationController < ActionController::Base
def set_locale def set_locale
I18n.locale = params[:locale] || I18n.default_locale I18n.locale = params[:locale] || I18n.default_locale
if user_signed_in? and current_user.language != I18n.locale
current_user.update(language: I18n.locale)
end
end end
def set_view_paths def set_view_paths