Sha256: 223dc3e9a37037b0bc6cd77de5dd58b97de010e4de0289e8105b9a075b2d7f0a
Contents?: true
Size: 780 Bytes
Versions: 7
Compression:
Stored size: 780 Bytes
Contents
# Autoloading in initializers is deprecated on rails 6.0. This delays initialization using the on_load # hooks, but does not change behaviour for existing rails versions. path_controller = ->() { class ::ActionController::Base def set_gettext_locale requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] || I18n.default_locale locale = FastGettext.set_locale(requested_locale) session[:locale] = locale I18n.locale = locale # some weird overwriting in action-controller makes this necessary ... see I18nProxy end end } if defined?(Rails) && Rails::VERSION::MAJOR >= 6 ActiveSupport.on_load(:action_controller_base) do path_controller.call end else path_controller.call end
Version data entries
7 entries across 7 versions & 1 rubygems