Sha256: b52dbb8ccf29600ea4c64f087a6b5303ea849aace60f2925abd59a5a55ea02da

Contents?: true

Size: 582 Bytes

Versions: 9

Compression:

Stored size: 582 Bytes

Contents

module AlchemyI18n
  class Engine < ::Rails::Engine
    initializer "alchemy-i18n" do |app|
      locales = Array(app.config.i18n.available_locales).reject { |l| l == :en }
      pattern = locales.empty? ? "*" : "{#{locales.join ","}}"
      files = Dir[root.join("locales", "alchemy.#{pattern}.yml")]
      I18n.load_path.concat(files)
      locales.each do |locale|
        Alchemy.importmap.pin "flatpickr/#{locale}.js", to: "https://ga.jspm.io/npm:flatpickr@4.6.13/dist/l10n/#{locale}.js"
        Alchemy.admin_js_imports << "flatpickr/#{locale}.js"
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_i18n-4.2.2 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.2.1 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.2.0 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.1.3 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.1.2 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.1.1 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.1.0 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.0.2 lib/alchemy_i18n/engine.rb
alchemy_i18n-4.0.1 lib/alchemy_i18n/engine.rb