class I18n::Railtie

def self.initialize_i18n(app)

Setup i18n configuration.
def self.initialize_i18n(app)
  return if @i18n_inited
  fallbacks = app.config.i18n.delete(:fallbacks)
  # Avoid issues with setting the default_locale by disabling available locales
  # check while configuring.
  enforce_available_locales = app.config.i18n.delete(:enforce_available_locales)
  enforce_available_locales = I18n.enforce_available_locales if enforce_available_locales.nil?
  I18n.enforce_available_locales = false
  reloadable_paths = []
  app.config.i18n.each do |setting, value|
    case setting
    when :railties_load_path
      reloadable_paths = value
      app.config.i18n.load_path.unshift(*value.flat_map(&:existent))
    when :load_path
      I18n.load_path += value
    when :raise_on_missing_translations
      strict = value == :strict
      setup_raise_on_missing_translations_config(app, strict)
    else
      I18n.public_send("#{setting}=", value)
    end
  end
  init_fallbacks(fallbacks) if fallbacks && validate_fallbacks(fallbacks)
  # Restore available locales check so it will take place from now on.
  I18n.enforce_available_locales = enforce_available_locales
  if app.config.reloading_enabled?
    directories = watched_dirs_with_extensions(reloadable_paths)
    root_load_paths = I18n.load_path.select { |path| path.to_s.start_with?(Rails.root.to_s) }
    reloader = app.config.file_watcher.new(root_load_paths, directories) do
      I18n.load_path.delete_if { |path| path.to_s.start_with?(Rails.root.to_s) && !File.exist?(path) }
      I18n.load_path |= reloadable_paths.flat_map(&:existent)
    end
    app.reloaders << reloader
    app.reloader.to_run do
      reloader.execute_if_updated { require_unload_lock! }
    end
  end
  @i18n_inited = true
end