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
-
.built_in_locales ⇒ Object
Returns the value of attribute built_in_locales.
Class Method Summary collapse
- .current_frontend_locale ⇒ Object
- .frontend_locales ⇒ Object
- .has_locale?(locale) ⇒ Boolean
- .url_filter_enabled? ⇒ Boolean
Class Attribute Details
.built_in_locales ⇒ Object
Returns the value of attribute built_in_locales.
11 12 13 |
# File 'lib/refinery/i18n.rb', line 11 def built_in_locales @built_in_locales end |
Class Method Details
.current_frontend_locale ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/refinery/i18n.rb', line 44 def current_frontend_locale if Globalize.locale.present? && Globalize.locale.to_s != config.default_frontend_locale.to_s Globalize.locale elsif config.default_frontend_locale.present? config.default_frontend_locale else ::I18n.locale end end |
.frontend_locales ⇒ Object
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
58 59 60 |
# File 'lib/refinery/i18n.rb', line 58 def has_locale?(locale) config.locales.has_key?(locale.try(:to_sym)) end |
.url_filter_enabled? ⇒ Boolean
54 55 56 |
# File 'lib/refinery/i18n.rb', line 54 def url_filter_enabled? config.url_filter_enabled end |