Fix switch_locale to return the block result

This commit is contained in:
Sebastian Serth
2021-06-28 16:08:24 +02:00
parent 4e8033f5d4
commit d08707f62e
3 changed files with 10 additions and 9 deletions

View File

@ -75,8 +75,8 @@ class ApplicationController < ActionController::Base
def switch_locale(&action)
session[:locale] = params[:custom_locale] || params[:locale] || session[:locale]
locale = session[:locale] || I18n.default_locale
I18n.with_locale(locale, &action)
Sentry.set_extras(locale: locale)
I18n.with_locale(locale, &action)
end
private :switch_locale