Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request fnando#72 from route/dependence_on_config
Browse files Browse the repository at this point in the history
Don't state dependency if config doesn't exist
  • Loading branch information
fnando committed Nov 29, 2011
2 parents 00422d2 + 888e9c5 commit 475178d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/i18n-js/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class Engine < ::Rails::Engine
initializer "i18n-js.asset_dependencies", :after => "sprockets.environment" do
next unless SimplesIdeias::I18n.has_asset_pipeline?

config = Rails.root.join("config", "i18n-js.yml")
config = I18n.config_file
cache_file = I18n::Engine.load_path_hash_cache

Rails.application.assets.register_preprocessor "application/javascript", :"i18n-js_dependencies" do |context, data|
if context.logical_path == I18N_TRANSLATIONS_ASSET
context.depend_on(config)
context.depend_on(config) if I18n.config?
# also set up dependencies on every locale file
::I18n.load_path.each {|path| context.depend_on(path)}

Expand Down

0 comments on commit 475178d

Please sign in to comment.