mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 01:41:42 +00:00
fix: no permitir idiomas que no existen en el cambio de idioma #13493
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
e35bddf915
commit
4e002e042b
1 changed files with 5 additions and 1 deletions
|
@ -59,7 +59,11 @@ class ApplicationController < ActionController::Base
|
|||
#
|
||||
# @return [String,Symbol]
|
||||
def current_locale
|
||||
session[:locale] = params[:change_locale_to] if params[:change_locale_to].present?
|
||||
locale = params[:change_locale_to]
|
||||
|
||||
if locale.present? && I18n.locale_available?(locale)
|
||||
session[:locale] = params[:change_locale_to]
|
||||
end
|
||||
|
||||
session[:locale] || current_usuarie&.lang || I18n.locale
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue