Fix invalid language resulting in no fallback being set on statuses (#17722)
This commit is contained in:
parent
8f6c67bfde
commit
c0327ff31f
3 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue