Try to use:
redirect_to edit_profile_path(:section => session[:section], :locale => I18n.locale)
or
class ApplicationController < ActionController::Base
before_action :set_locale
def default_url_options(options={})
{ locale: I18n.locale }
end
protected
def set_locale
I18n.locale = (session[:locale] || params[:locale]).to_s.downcase.presence || I18n.default_locale
end
end
this will help.