Parent

Class/Module Index [+]

Quicksearch

I18n::Railtie

Public Class Methods

reloader() click to toggle source
# File lib/active_support/i18n_railtie.rb, line 13
def self.reloader
  @reloader ||= ActiveSupport::FileUpdateChecker.new([]){ I18n.reload! }
end

Protected Class Methods

include_fallbacks_module() click to toggle source
# File lib/active_support/i18n_railtie.rb, line 51
def self.include_fallbacks_module
  I18n.backend.class.send(:include, I18n::Backend::Fallbacks)
end
init_fallbacks(fallbacks) click to toggle source
# File lib/active_support/i18n_railtie.rb, line 55
def self.init_fallbacks(fallbacks)
  include_fallbacks_module

  args = case fallbacks
  when ActiveSupport::OrderedOptions
    [*(fallbacks[:defaults] || []) << fallbacks[:map]].compact
  when Hash, Array
    Array.wrap(fallbacks)
  else # TrueClass
    []
  end

  I18n.fallbacks = I18n::Locale::Fallbacks.new(*args)
end
validate_fallbacks(fallbacks) click to toggle source
# File lib/active_support/i18n_railtie.rb, line 70
def self.validate_fallbacks(fallbacks)
  case fallbacks
  when ActiveSupport::OrderedOptions
    !fallbacks.empty?
  when TrueClass, Array, Hash
    true
  else
    raise "Unexpected fallback type #{fallbacks.inspect}"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.