Module: I18nExtension

Defined in:
lib/spree_change_locale/i18n_extension.rb

Instance Method Summary collapse

Instance Method Details

#enabled_localesObject



2
3
4
# File 'lib/spree_change_locale/i18n_extension.rb', line 2

def enabled_locales
  @@enabled_locales ||= (Spree::Config.get(:enabled_locales) || get_locales || I18n.available_locales || [I18n.default_locale]).collect(&:to_sym)
end

#locale_enabled?(locale) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/spree_change_locale/i18n_extension.rb', line 5

def locale_enabled?(locale)
  enabled_locales.include?(locale.to_sym)
end