Module: Agave::Utils::LocaleValue

Defined in:
lib/agave/utils/locale_value.rb

Class Method Summary collapse

Class Method Details

.find(obj) ⇒ Object



7
8
9
10
11
12
# File 'lib/agave/utils/locale_value.rb', line 7

def self.find(obj)
  locale_with_value = I18n.fallbacks[I18n.locale]
                          .find { |locale| obj[locale] }

  obj[locale_with_value || I18n.locale]
end