Sha256: 21dba7efcb35f814780f308beff5f82822dba04f646b3976f0012e39951e64b6

Contents?: true

Size: 1014 Bytes

Versions: 5

Compression:

Stored size: 1014 Bytes

Contents

require 'rails-assets-html2canvas'

module TranslationEngine
  class Engine < ::Rails::Engine
    isolate_namespace TranslationEngine

    initializer "translation_engine.middlewares" do |app|
      app.config.app_middleware.use TranslationEngine::CatcherMiddleware
      app.config.app_middleware.use TranslationEngine::KeysMiddleware
      app.config.app_middleware.use TranslationEngine::ScreenshotsMiddleware
    end

    initializer "translation_engine.assets.precompile" do |app|
      app.config.assets.precompile += %w(
        translation_engine/screenshots.css
        translation_engine/screenshots.js
      )
      %w(stylesheets javascripts).each do |sub|
        app.config.assets.paths << root.join('app', 'assets', sub).to_s
      end
    end

    if !Rails.const_defined?('Console')
      config.after_initialize do |app|
        if TranslationEngine.use_catcher || TranslationEngine.use_screenshots
          I18n.backend = TranslationEngine::Backend.new
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
translation_engine-0.0.5 lib/translation_engine/engine.rb
translation_engine-0.0.4 lib/translation_engine/engine.rb
translation_engine-0.0.3 lib/translation_engine/engine.rb
translation_engine-0.0.2 lib/translation_engine/engine.rb
translation_engine-0.0.1 lib/translation_engine/engine.rb