Sha256: c7101a450d29ab36ad8aff99c406cbd8e544c16c01d11a1656f74ee1e4c187a6

Contents?: true

Size: 580 Bytes

Versions: 1

Compression:

Stored size: 580 Bytes

Contents

require 'rails'
module DeviseBootstrapViews
  class Engine < ::Rails::Engine
  end

  class Railtie < ::Rails::Railtie #:nodoc:
    initializer 'rails-i18n-views' do |app|
      DeviseBootstrapViews::Railtie.instance_eval do
        pattern = pattern_from app.config.i18n.available_locales

        files = Dir[File.join(File.dirname(__FILE__), '../locales', "#{pattern}.yml")]
        I18n.load_path.concat(files)
      end
    end

    protected

    def self.pattern_from(args)
      array = Array(args || [])
      array.blank? ? '*' : "{#{array.join ','}}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
devise-bootstrap-views-0.0.1 lib/devise-bootstrap-views.rb