diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6f6728712a..a14a7756b8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -76,6 +76,7 @@ def set_gettext_locale locale = AlaveteliLocalization.set_session_locale( params[:locale], + current_user&.locale, # FIXME: Do we really want to use the user locale, or prioritise the session? session[:locale], cookies[:locale], browser_locale, diff --git a/spec/integration/track_alerts_spec.rb b/spec/integration/track_alerts_spec.rb index 2fc84fd81f..35d337d012 100644 --- a/spec/integration/track_alerts_spec.rb +++ b/spec/integration/track_alerts_spec.rb @@ -21,7 +21,7 @@ other_user = FactoryBot.create(:user) other_user_session = login(other_user) using_session(other_user_session) do - visit "en/annotate/request/#{info_request.url_title}" + visit "annotate/request/#{info_request.url_title}" fill_in "comment[body]", with: 'test comment' click_button 'Preview your annotation' click_button 'Post annotation' @@ -67,7 +67,7 @@ locale: 'es') user_session = login(user) using_session(user_session) do - visit "es/request/#{info_request.url_title}/track" + visit "request/#{info_request.url_title}/track" end other_user = FactoryBot.create(:user, locale: 'en')