Module: Refinery::I18n

Includes:
ActiveSupport::Configurable
Defined in:
lib/refinery/i18n.rb,
lib/refinery/i18n/engine.rb,
lib/refinery/i18n/configuration.rb

Defined Under Namespace

Classes: Engine

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.built_in_localesObject

Returns the value of attribute built_in_locales.



13
14
15
# File 'lib/refinery/i18n.rb', line 13

def built_in_locales
  @built_in_locales
end

Class Method Details

.current_frontend_localeObject



46
47
48
49
50
51
52
53
54
# File 'lib/refinery/i18n.rb', line 46

def current_frontend_locale
  if Mobility.locale.present? && Mobility.locale.to_s != config.default_frontend_locale.to_s
    Mobility.locale
  elsif config.default_frontend_locale.present?
    config.default_frontend_locale
  else
    ::I18n.locale
  end
end

.frontend_localesObject



17
18
19
20
21
# File 'lib/refinery/i18n/configuration.rb', line 17

def self.frontend_locales
  config.frontend_locales.select do |locale|
    config.locales.keys.map(&:to_s).include?(locale.to_s)
  end
end

.has_locale?(locale) ⇒ Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/refinery/i18n.rb', line 60

def has_locale?(locale)
  config.locales.has_key?(locale.try(:to_sym))
end

.url_filter_enabled?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/refinery/i18n.rb', line 56

def url_filter_enabled?
  config.url_filter_enabled
end