Fix error 500 when passing an invalid lang parameter (#33467)

This commit is contained in:
Claire authored and GitHub committed 2025-01-06 10:16:42 +00:00
1 parent dbbf450ef5
commit ea9b10d112
1 file changed
+1 -1
+1 -1
View File
@@ -25,7 +25,7 @@ module Localized
end
def available_locale_or_nil(locale_name)
locale_name.to_sym if locale_name.present? && I18n.available_locales.include?(locale_name.to_sym)
locale_name.to_sym if locale_name.respond_to?(:to_sym) && I18n.available_locales.include?(locale_name.to_sym)
end
def content_locale