mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 16:23:38 +00:00
Merge branch 'issue-10478' into 'rails'
fix: hacer que devise respete el idioma de la sesión #10478 See merge request sutty/sutty!140
This commit is contained in:
commit
07f4ae2473
1 changed files with 21 additions and 0 deletions
21
app/lib/devise/failure_app_decorator.rb
Normal file
21
app/lib/devise/failure_app_decorator.rb
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Devise
|
||||||
|
module FailureAppDecorator
|
||||||
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
included do
|
||||||
|
include AbstractController::Callbacks
|
||||||
|
|
||||||
|
around_action :set_locale
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def set_locale(&action)
|
||||||
|
I18n.with_locale(session[:locale] || I18n.locale, &action)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Devise::FailureApp.include Devise::FailureAppDecorator
|
Loading…
Reference in a new issue