Skip to content

Commit

Permalink
Merge branch 'i18n-fix'
Browse files Browse the repository at this point in the history
Fixes #466
  • Loading branch information
mislav committed Sep 21, 2016
2 parents 89c8b6c + c8361be commit a3df0ae
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/will_paginate/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class Railtie < Rails::Railtie
require 'will_paginate/view_helpers/action_view'
end

self.class.add_locale_path config

# early access to ViewHelpers.pagination_options
require 'will_paginate/view_helpers'
end
Expand All @@ -31,10 +29,6 @@ def self.setup_actioncontroller
ActionController::Base.extend ControllerRescuePatch
end

def self.add_locale_path(config)
config.i18n.load_path.unshift(*WillPaginate::I18n.load_path)
end

# Extending the exception handler middleware so it properly detects
# WillPaginate::InvalidPage regardless of it being a tag module.
module ShowExceptionsPatch
Expand Down Expand Up @@ -69,3 +63,7 @@ def rescue_from(*args, &block)
end
end
end

ActiveSupport.on_load :i18n do
I18n.load_path.concat(WillPaginate::I18n.load_path)
end

0 comments on commit a3df0ae

Please sign in to comment.