lib/i18n/js/engine.rb in i18n-js-3.0.0.rc5 vs lib/i18n/js/engine.rb in i18n-js-3.0.0.rc6
- old
+ new
@@ -2,18 +2,17 @@
module I18n
module JS
class Engine < ::Rails::Engine
initializer :after => "sprockets.environment" do
- ActiveSupport.on_load(:after_initialize, :yield => true) do
- next unless JS.has_asset_pipeline?
- next unless Rails.configuration.assets.compile
+ next unless JS::Dependencies.using_asset_pipeline?
+ next unless Rails.configuration.assets.compile
- Rails.application.assets.register_preprocessor "application/javascript", :"i18n-js_dependencies" do |context, source|
- next source unless context.logical_path == "i18n/translations"
- ::I18n.load_path.each {|path| context.depend_on(path)}
- source
+ Rails.application.assets.register_preprocessor "application/javascript", :"i18n-js_dependencies" do |context, source|
+ if context.logical_path == "i18n/filtered"
+ ::I18n.load_path.each {|path| context.depend_on(File.expand_path(path))}
end
+ source
end
end
end
end
end