Sha256: 2a84995ade79b5668d9be7f72f4ac632c9b36ab16d544f1a1f26b011da348d69

Contents?: true

Size: 811 Bytes

Versions: 18

Compression:

Stored size: 811 Bytes

Contents

# frozen_string_literal: true

require 'i18n/backend/active_record'
require 'i18n/backend/fallbacks'

Translation = I18n::Backend::ActiveRecord::Translation

if Translation.table_exists?
  ##
  # Sets up the new Spotlight Translation backend, backed by ActiveRecord. To
  # turn on the ActiveRecord backend, uncomment the following lines.

  I18n.backend = I18n::Backend::ActiveRecord.new
  I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Memoize)
  Translation.send(:include, Spotlight::CustomTranslationExtension)
  I18n::Backend::Simple.send(:include, I18n::Backend::Memoize)
  I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
  I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)

  I18n.backend = I18n::Backend::Chain.new(I18n.backend, I18n::Backend::Simple.new)
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.2 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-3.0.0.alpha.1 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.13.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.12.1 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.12.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.11.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.10.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.9.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.8.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.7.2 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.7.1 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.7.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.6.1.1 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.6.1 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.6.0 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.5.2 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.5.1 lib/generators/spotlight/templates/config/initializers/translation.rb
blacklight-spotlight-2.5.0 lib/generators/spotlight/templates/config/initializers/translation.rb