Store locale in a user's field and switch locale on mailers

This commit is contained in:
Josep Jaume Rey Peroy
2016-01-22 16:51:41 +01:00
parent 8a4deba48e
commit cf00f12ec7
12 changed files with 100 additions and 7 deletions

View File

@@ -52,7 +52,14 @@ class ApplicationController < ActionController::Base
session[:locale] ||= I18n.default_locale
I18n.locale = session[:locale]
locale = session[:locale]
if current_user
current_user.locale = locale
current_user.save
end
I18n.locale = locale
end
def set_layout