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.



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

def built_in_locales
  @built_in_locales
end

Class Method Details

.current_frontend_localeObject



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

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)


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

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

.url_filter_enabled?Boolean

Returns:

  • (Boolean)


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

def url_filter_enabled?
  config.url_filter_enabled
end