Update locale before loading flash notice on user language update

This commit is contained in:
Gonzalo Rodriguez 2011-02-19 02:25:03 -02:00
parent 199d5fbdc1
commit 778afa2889

View file

@ -35,6 +35,7 @@ class UsersController < ApplicationController
end
elsif params[:user][:language]
if @user.update_attributes(:language => params[:user][:language])
I18n.locale = @user.language
flash[:notice] = I18n.t 'users.update.language_changed'
else
flash[:error] = I18n.t 'users.update.language_not_changed'