0
0
Fork 0

Fix invalid language resulting in no fallback being set on statuses (#17722)

This commit is contained in:
Eugen Rochko 2022-03-09 08:46:05 +01:00 committed by GitHub
parent 8f6c67bfde
commit c0327ff31f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View file

@ -241,6 +241,15 @@ module LanguagesHelper
code
end
def valid_locale_cascade(*arr)
arr.each do |str|
locale = valid_locale_or_nil(str)
return locale if locale.present?
end
nil
end
def valid_locale?(locale)
locale.present? && SUPPORTED_LOCALES.key?(locale.to_sym)
end